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

Unified Diff: tools/gn/test_with_scope.cc

Issue 1530183005: Special-case paths that appear in libs by not prefixing them with -l. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo in previous patch Created 5 years 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/target_unittest.cc ('k') | tools/gn/value_extractors.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/test_with_scope.cc
diff --git a/tools/gn/test_with_scope.cc b/tools/gn/test_with_scope.cc
index 896b5792dfe99ec1e57ff3dc4703c8af4f8246e6..a6953ae78057f88ecf35bb7cf46a455a400852a7 100644
--- a/tools/gn/test_with_scope.cc
+++ b/tools/gn/test_with_scope.cc
@@ -84,6 +84,8 @@ void TestWithScope::SetupToolchain(Toolchain* toolchain) {
// ALINK
scoped_ptr<Tool> alink_tool(new Tool);
SetCommandForTool("ar {{output}} {{source}}", alink_tool.get());
+ alink_tool->set_lib_switch("-l");
+ alink_tool->set_lib_dir_switch("-L");
alink_tool->set_output_prefix("lib");
alink_tool->set_outputs(SubstitutionList::MakeForTest(
"{{target_out_dir}}/{{target_output_name}}.a"));
@@ -93,6 +95,8 @@ void TestWithScope::SetupToolchain(Toolchain* toolchain) {
scoped_ptr<Tool> solink_tool(new Tool);
SetCommandForTool("ld -shared -o {{target_output_name}}.so {{inputs}} "
"{{ldflags}} {{libs}}", solink_tool.get());
+ solink_tool->set_lib_switch("-l");
+ solink_tool->set_lib_dir_switch("-L");
solink_tool->set_output_prefix("lib");
solink_tool->set_default_output_extension(".so");
solink_tool->set_outputs(SubstitutionList::MakeForTest(
@@ -103,6 +107,8 @@ void TestWithScope::SetupToolchain(Toolchain* toolchain) {
scoped_ptr<Tool> solink_module_tool(new Tool);
SetCommandForTool("ld -bundle -o {{target_output_name}}.so {{inputs}} "
"{{ldflags}} {{libs}}", solink_module_tool.get());
+ solink_module_tool->set_lib_switch("-l");
+ solink_module_tool->set_lib_dir_switch("-L");
solink_module_tool->set_output_prefix("lib");
solink_module_tool->set_default_output_extension(".so");
solink_module_tool->set_outputs(SubstitutionList::MakeForTest(
@@ -113,6 +119,8 @@ void TestWithScope::SetupToolchain(Toolchain* toolchain) {
scoped_ptr<Tool> link_tool(new Tool);
SetCommandForTool("ld -o {{target_output_name}} {{source}} "
"{{ldflags}} {{libs}}", link_tool.get());
+ link_tool->set_lib_switch("-l");
+ link_tool->set_lib_dir_switch("-L");
link_tool->set_outputs(SubstitutionList::MakeForTest(
"{{root_out_dir}}/{{target_output_name}}"));
toolchain->SetTool(Toolchain::TYPE_LINK, link_tool.Pass());
« no previous file with comments | « tools/gn/target_unittest.cc ('k') | tools/gn/value_extractors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698