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

Side by Side Diff: tools/gn/test_with_scope.cc

Issue 1386783003: [GN]: Support for loadable modules (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/gn/test_with_scope.h" 5 #include "tools/gn/test_with_scope.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "tools/gn/parser.h" 8 #include "tools/gn/parser.h"
9 #include "tools/gn/tokenizer.h" 9 #include "tools/gn/tokenizer.h"
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // SOLINK 92 // SOLINK
93 scoped_ptr<Tool> solink_tool(new Tool); 93 scoped_ptr<Tool> solink_tool(new Tool);
94 SetCommandForTool("ld -shared -o {{target_output_name}}.so {{inputs}} " 94 SetCommandForTool("ld -shared -o {{target_output_name}}.so {{inputs}} "
95 "{{ldflags}} {{libs}}", solink_tool.get()); 95 "{{ldflags}} {{libs}}", solink_tool.get());
96 solink_tool->set_output_prefix("lib"); 96 solink_tool->set_output_prefix("lib");
97 solink_tool->set_default_output_extension(".so"); 97 solink_tool->set_default_output_extension(".so");
98 solink_tool->set_outputs(SubstitutionList::MakeForTest( 98 solink_tool->set_outputs(SubstitutionList::MakeForTest(
99 "{{root_out_dir}}/{{target_output_name}}{{output_extension}}")); 99 "{{root_out_dir}}/{{target_output_name}}{{output_extension}}"));
100 toolchain->SetTool(Toolchain::TYPE_SOLINK, solink_tool.Pass()); 100 toolchain->SetTool(Toolchain::TYPE_SOLINK, solink_tool.Pass());
101 101
102 // SOLINK_MODULE
103 scoped_ptr<Tool> solink_module_tool(new Tool);
104 SetCommandForTool("ld -bundle -o {{target_output_name}}.so {{inputs}} "
105 "{{ldflags}} {{libs}}", solink_module_tool.get());
106 solink_module_tool->set_output_prefix("lib");
107 solink_module_tool->set_default_output_extension(".so");
108 solink_module_tool->set_outputs(SubstitutionList::MakeForTest(
109 "{{root_out_dir}}/{{target_output_name}}{{output_extension}}"));
110 toolchain->SetTool(Toolchain::TYPE_SOLINK_MODULE, solink_module_tool.Pass());
111
102 // LINK 112 // LINK
103 scoped_ptr<Tool> link_tool(new Tool); 113 scoped_ptr<Tool> link_tool(new Tool);
104 SetCommandForTool("ld -o {{target_output_name}} {{source}} " 114 SetCommandForTool("ld -o {{target_output_name}} {{source}} "
105 "{{ldflags}} {{libs}}", link_tool.get()); 115 "{{ldflags}} {{libs}}", link_tool.get());
106 link_tool->set_outputs(SubstitutionList::MakeForTest( 116 link_tool->set_outputs(SubstitutionList::MakeForTest(
107 "{{root_out_dir}}/{{target_output_name}}")); 117 "{{root_out_dir}}/{{target_output_name}}"));
108 toolchain->SetTool(Toolchain::TYPE_LINK, link_tool.Pass()); 118 toolchain->SetTool(Toolchain::TYPE_LINK, link_tool.Pass());
109 119
110 // STAMP 120 // STAMP
111 scoped_ptr<Tool> stamp_tool(new Tool); 121 scoped_ptr<Tool> stamp_tool(new Tool);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 const std::string& label_string, 160 const std::string& label_string,
151 Target::OutputType type) 161 Target::OutputType type)
152 : Target(setup.settings(), setup.ParseLabel(label_string)) { 162 : Target(setup.settings(), setup.ParseLabel(label_string)) {
153 visibility().SetPublic(); 163 visibility().SetPublic();
154 set_output_type(type); 164 set_output_type(type);
155 SetToolchain(setup.toolchain()); 165 SetToolchain(setup.toolchain());
156 } 166 }
157 167
158 TestTarget::~TestTarget() { 168 TestTarget::~TestTarget() {
159 } 169 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698