Home | History | Annotate | Download | only in gn

Lines Matching refs:toolchain

15 #include "tools/gn/toolchain.h"
24 // the toolchain property on a scope.
165 bool IsCompilerTool(Toolchain::ToolType type) {
166 return type == Toolchain::TYPE_CC ||
167 type == Toolchain::TYPE_CXX ||
168 type == Toolchain::TYPE_OBJC ||
169 type == Toolchain::TYPE_OBJCXX ||
170 type == Toolchain::TYPE_RC ||
171 type == Toolchain::TYPE_ASM;
174 bool IsLinkerTool(Toolchain::ToolType type) {
175 return type == Toolchain::TYPE_ALINK ||
176 type == Toolchain::TYPE_SOLINK ||
177 type == Toolchain::TYPE_LINK;
194 // toolchain -------------------------------------------------------------------
196 const char kToolchain[] = "toolchain";
198 "toolchain: Defines a toolchain.";
200 "toolchain: Defines a toolchain.\n"
202 " A toolchain is a set of commands and build flags used to compile the\n"
203 " source code. You can have more than one toolchain in use at once in\n"
213 " List of arguments to pass to the toolchain when invoking this\n"
214 " toolchain. This applies only to non-default toolchains. See\n"
218 " Dependencies of this toolchain. These dependencies will be resolved\n"
219 " before any target in the toolchain is compiled. To avoid circular\n"
220 " dependencies these must be targets defined in another toolchain.\n"
223 " will always specify a toolchain:\n"
224 " deps = [ \"//foo/bar:baz(//build/toolchain:bootstrap)\" ]\n"
241 " The value used will be the one from the default toolchain of the\n"
247 " toolchain label that is inherited, so the dependee has the same one\n"
250 " You can override this and refer to any other toolchain by explicitly\n"
251 " labeling the toolchain to use. For example:\n"
254 " identifies the toolchain declaration for compiling the sources.\n"
256 " To load a file in an alternate toolchain, GN does the following:\n"
258 " 1. Loads the file with the toolchain definition in it (as determined\n"
259 " by the toolchain label).\n"
261 " arguments specified by the toolchain_args section of the toolchain\n"
267 " toolchain(\"plugin_toolchain\") {\n"
292 // the toolchain name in the label, and toolchain labels don't themselves
293 // have toolchain names.
297 g_scheduler->Log("Definining toolchain", label.GetUserVisibleName(false));
299 // This object will actually be copied into the one owned by the toolchain
301 scoped_ptr<Toolchain> toolchain(new Toolchain(scope->settings(), label));
302 toolchain->set_defined_from(function);
303 toolchain->visibility().SetPublic();
306 block_scope.SetProperty(&kToolchainPropertyKey, toolchain.get());
317 ToolchainLabelForScope(&block_scope), &toolchain->deps(), err);
333 toolchain->set_concurrent_links(
340 // Save this toolchain.
341 toolchain->ToolchainSetupComplete();
344 *err = Err(function, "Can't define a toolchain in this context.");
347 collector->push_back(new scoped_ptr<Item>(toolchain.PassAs<Item>()));
355 "tool: Specify arguments to a toolchain tool.";
357 "tool: Specify arguments to a toolchain tool.\n"
553 " \"description\" field for link tools. The toolchain will be\n"
554 " omitted from the label for targets in the default toolchain, and\n"
702 " toolchain(\"my_toolchain\") {\n"
724 // Find the toolchain definition we're executing inside of. The toolchain
726 Toolchain* toolchain = reinterpret_cast<Toolchain*>(
728 if (!toolchain) {
729 *err = Err(function->function(), "tool() called outside of toolchain().",
730 "The tool() function can only be used inside a toolchain() "
738 Toolchain::ToolType tool_type = Toolchain::ToolNameToType(tool_name);
739 if (tool_type == Toolchain::TYPE_NONE) {
761 } else if (tool_type == Toolchain::TYPE_COPY) {
797 if (tool_type != Toolchain::TYPE_COPY && tool_type != Toolchain::TYPE_STAMP) {
808 if (tool_type != Toolchain::TYPE_SOLINK) {
820 if (tool_type != Toolchain::TYPE_SOLINK) {
842 toolchain->SetTool(tool_type, tool.Pass());
850 "toolchain_args: Set build arguments for toolchain build setup.";
852 "toolchain_args: Set build arguments for toolchain build setup.\n"
854 " Used inside a toolchain definition to pass arguments to an alternate\n"
855 " toolchain's invocation of the build.\n"
857 " When you specify a target using an alternate toolchain, the master\n"
859 " toolchain (see \"gn help toolchain\"). The toolchain_args function\n"
867 " The toolchain_args will be ignored when the toolchain being defined\n"
874 " toolchain(\"my_weird_toolchain\") {\n"
881 " # Pass this new value for specific setup for my toolchain.\n"
891 // Find the toolchain definition we're executing inside of. The toolchain
893 Toolchain* toolchain = reinterpret_cast<Toolchain*>(
895 if (!toolchain) {
897 "toolchain_args() called outside of toolchain().",
899 "toolchain() definition.");
909 // we then save on the toolchain to use when re-invoking the build.
917 toolchain->args() = values;