Home | History | Annotate | Download | only in gn

Lines Matching defs:toolchain

11 #include "tools/gn/toolchain.h"
19 // the toolchain property on a scope.
37 // toolchain -------------------------------------------------------------------
39 const char kToolchain[] = "toolchain";
41 "toolchain: Defines a toolchain.";
43 "toolchain: Defines a toolchain.\n"
45 " A toolchain is a set of commands and build flags used to compile the\n"
46 " source code. You can have more than one toolchain in use at once in\n"
49 " A toolchain specifies the commands to run for various input file\n"
51 " arguments to be passed to the toolchain build via the\n"
57 " toolchain label that is inherited, so the dependee has the same one\n"
60 " You can override this and refer to any other toolchain by explicitly\n"
61 " labeling the toolchain to use. For example:\n"
64 " identifies the toolchain declaration for compiling the sources.\n"
66 " To load a file in an alternate toolchain, GN does the following:\n"
68 " 1. Loads the file with the toolchain definition in it (as determined\n"
69 " by the toolchain label).\n"
71 " arguments specified by the toolchain_args section of the toolchain\n"
77 " toolchain(\"plugin_toolchain\") {\n"
99 // the toolchain name in the label, and toolchain labels don't themselves
100 // have toolchain names.
104 g_scheduler->Log("Definining toolchain", label.GetUserVisibleName(false));
106 // This object will actually be copied into the one owned by the toolchain
108 scoped_ptr<Toolchain> toolchain(new Toolchain(scope->settings(), label));
109 toolchain->set_defined_from(function);
110 toolchain->visibility().SetPublic();
113 block_scope.SetProperty(&kToolchainPropertyKey, toolchain.get());
125 *err = Err(function, "Can't define a toolchain in this context.");
128 collector->push_back(new scoped_ptr<Item>(toolchain.PassAs<Item>()));
136 "tool: Specify arguments to a toolchain tool.";
138 "tool: Specify arguments to a toolchain tool.\n"
142 " Used inside a toolchain definition to define a command to run for a\n"
143 " given file type. See also \"gn help toolchain\".\n"
172 " toolchain(\"my_toolchain\") {\n"
192 // Find the toolchain definition we're executing inside of. The toolchain
194 Toolchain* toolchain = reinterpret_cast<Toolchain*>(
196 if (!toolchain) {
197 *err = Err(function->function(), "tool() called outside of toolchain().",
198 "The tool() function can only be used inside a toolchain() "
206 Toolchain::ToolType tool_type = Toolchain::ToolNameToType(tool_name);
207 if (tool_type == Toolchain::TYPE_NONE) {
219 Toolchain::Tool t;
236 toolchain->SetTool(tool_type, t);
244 "toolchain_args: Set build arguments for toolchain build setup.";
246 "toolchain_args: Set build arguments for toolchain build setup.\n"
248 " Used inside a toolchain definition to pass arguments to an alternate\n"
249 " toolchain's invocation of the build.\n"
251 " When you specify a target using an alternate toolchain, the master\n"
253 " toolchain (see \"gn help toolchain\"). The toolchain_args function\n"
261 " The toolchain_args will be ignored when the toolchain being defined\n"
268 " toolchain(\"my_weird_toolchain\") {\n"
275 " # Pass this new value for specific setup for my toolchain.\n"
285 // Find the toolchain definition we're executing inside of. The toolchain
287 Toolchain* toolchain = reinterpret_cast<Toolchain*>(
289 if (!toolchain) {
291 "toolchain_args() called outside of toolchain().",
293 "toolchain() definition.");
303 // we then save on the toolchain to use when re-invoking the build.
311 toolchain->args() = values;