Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: tools/gn/function_toolchain.cc

Issue 1904473002: Add arflags to GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/docs/reference.md ('k') | tools/gn/ninja_binary_target_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_toolchain.cc
diff --git a/tools/gn/function_toolchain.cc b/tools/gn/function_toolchain.cc
index bdf53859e6f914e4df210f5323b2eecea4a850a5..aaa9b7efaa739fbe43fc3f0fae702de55b142373 100644
--- a/tools/gn/function_toolchain.cc
+++ b/tools/gn/function_toolchain.cc
@@ -194,8 +194,8 @@ bool IsCompilerTool(Toolchain::ToolType type) {
}
bool IsLinkerTool(Toolchain::ToolType type) {
- return type == Toolchain::TYPE_ALINK ||
- type == Toolchain::TYPE_SOLINK ||
+ // "alink" is not counted as in the generic "linker" tool list.
+ return type == Toolchain::TYPE_SOLINK ||
type == Toolchain::TYPE_SOLINK_MODULE ||
type == Toolchain::TYPE_LINK;
}
@@ -690,6 +690,7 @@ const char kTool_Help[] =
" Example: \"gen/base/test\"\n"
"\n"
" Linker tools have multiple inputs and (potentially) multiple outputs\n"
+ " The static library tool (\"alink\") is not considered a linker tool.\n"
" The following expansions are available:\n"
"\n"
" {{inputs}}\n"
@@ -749,6 +750,9 @@ const char kTool_Help[] =
" These should generally be treated the same as libs by your tool.\n"
" Example: \"libfoo.so libbar.so\"\n"
"\n"
+ " The static library (\"alink\") tool allows {{arflags}} plus the common\n"
+ " tool substitutions.\n"
+ "\n"
" The copy tool allows the common compiler/linker substitutions, plus\n"
" {{source}} which is the source of the copy. The stamp tool allows\n"
" only the common tool substitutions.\n"
@@ -859,6 +863,10 @@ Value RunTool(Scope* scope,
} else if (IsLinkerTool(tool_type)) {
subst_validator = &IsValidLinkerSubstitution;
subst_output_validator = &IsValidLinkerOutputsSubstitution;
+ } else if (tool_type == Toolchain::TYPE_ALINK) {
+ subst_validator = &IsValidALinkSubstitution;
+ // ALink uses the standard output file patterns as other linker tools.
+ subst_output_validator = &IsValidLinkerOutputsSubstitution;
} else if (tool_type == Toolchain::TYPE_COPY ||
tool_type == Toolchain::TYPE_COPY_BUNDLE_DATA) {
subst_validator = &IsValidCopySubstitution;
« no previous file with comments | « tools/gn/docs/reference.md ('k') | tools/gn/ninja_binary_target_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698