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.\n"
43 " A toolchain is a set of commands and build flags used to compile the\n"
44 " source code. You can have more than one toolchain in use at once in\n"
47 " A toolchain specifies the commands to run for various input file\n"
49 " arguments to be passed to the toolchain build via the\n"
55 " toolchain label that is inherited, so the dependee has the same one\n"
58 " You can override this and refer to any other toolchain by explicitly\n"
59 " labeling the toolchain to use. For example:\n"
62 " identifies the toolchain declaration for compiling the sources.\n"
64 " To load a file in an alternate toolchain, GN does the following:\n"
66 " 1. Loads the file with the toolchain definition in it (as determined\n"
67 " by the toolchain label).\n"
69 " arguments specified by the toolchain_args section of the toolchain\n"
75 " toolchain(\"plugin_toolchain\") {\n"
97 // the toolchain name in the label, and toolchain labels don't themselves
98 // have toolchain names.
102 g_scheduler->Log("Definining toolchain", label.GetUserVisibleName(false));
104 // This object will actually be copied into the one owned by the toolchain
106 scoped_ptr<Toolchain> toolchain(new Toolchain(scope->settings(), label));
107 toolchain->set_defined_from(function);
110 block_scope.SetProperty(&kToolchainPropertyKey, toolchain.get());
122 toolchain->set_gyp_header(gyp_header_value->string_value());
128 scope->settings()->build_settings()->ItemDefined(toolchain.PassAs<Item>());
136 "tool: Specify arguments to a toolchain tool.\n"
140 " Used inside a toolchain definition to define a command to run for a\n"
141 " given file type. See also \"gn help toolchain\".\n"
170 " toolchain(\"my_toolchain\") {\n"
190 // Find the toolchain definition we're executing inside of. The toolchain
192 Toolchain* toolchain = reinterpret_cast<Toolchain*>(
194 if (!toolchain) {
195 *err = Err(function->function(), "tool() called outside of toolchain().",
196 "The tool() function can only be used inside a toolchain() "
204 Toolchain::ToolType tool_type = Toolchain::ToolNameToType(tool_name);
205 if (tool_type == Toolchain::TYPE_NONE) {
217 Toolchain::Tool t;
234 toolchain->SetTool(tool_type, t);
242 "toolchain_args: Set build arguments for toolchain build setup.\n"
244 " Used inside a toolchain definition to pass arguments to an alternate\n"
245 " toolchain's invocation of the build.\n"
247 " When you specify a target using an alternate toolchain, the master\n"
249 " toolchain (see \"gn help toolchain\"). The toolchain_args function\n"
257 " The toolchain_args will be ignored when the toolchain being defined\n"
264 " toolchain(\"my_weird_toolchain\") {\n"
271 " # Pass this new value for specific setup for my toolchain.\n"
281 // Find the toolchain definition we're executing inside of. The toolchain
283 Toolchain* toolchain = reinterpret_cast<Toolchain*>(
285 if (!toolchain) {
287 "toolchain_args() called outside of toolchain().",
289 "toolchain() definition.");
299 // we then save on the toolchain to use when re-invoking the build.
307 toolchain->args() = values;