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

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

Issue 26267003: Add the concept of a source set to GN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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/ninja_helper.h" 5 #include "tools/gn/ninja_helper.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "tools/gn/filesystem_utils.h" 8 #include "tools/gn/filesystem_utils.h"
9 #include "tools/gn/string_utils.h" 9 #include "tools/gn/string_utils.h"
10 #include "tools/gn/target.h" 10 #include "tools/gn/target.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 if (!target->settings()->IsWin() && 125 if (!target->settings()->IsWin() &&
126 (target->output_type() == Target::SHARED_LIBRARY || 126 (target->output_type() == Target::SHARED_LIBRARY ||
127 target->output_type() == Target::STATIC_LIBRARY) && 127 target->output_type() == Target::STATIC_LIBRARY) &&
128 name.compare(0, 3, "lib") != 0) 128 name.compare(0, 3, "lib") != 0)
129 prefix = "lib"; 129 prefix = "lib";
130 else 130 else
131 prefix = ""; 131 prefix = "";
132 132
133 const char* extension; 133 const char* extension;
134 if (target->output_type() == Target::GROUP || 134 if (target->output_type() == Target::GROUP ||
135 target->output_type() == Target::SOURCE_SET ||
135 target->output_type() == Target::COPY_FILES || 136 target->output_type() == Target::COPY_FILES ||
136 target->output_type() == Target::CUSTOM) { 137 target->output_type() == Target::CUSTOM) {
137 extension = "stamp"; 138 extension = "stamp";
138 } else { 139 } else {
139 extension = GetExtensionForOutputType(target->output_type(), 140 extension = GetExtensionForOutputType(target->output_type(),
140 target->settings()->target_os()); 141 target->settings()->target_os());
141 } 142 }
142 143
143 // Everything goes into the toolchain directory (which will be empty for the 144 // Everything goes into the toolchain directory (which will be empty for the
144 // default toolchain, and will end in a slash otherwise). 145 // default toolchain, and will end in a slash otherwise).
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 if (settings->IsWin()) { 224 if (settings->IsWin()) {
224 if (type == SOURCE_RC) 225 if (type == SOURCE_RC)
225 return prefix + "rc"; 226 return prefix + "rc";
226 } else { 227 } else {
227 if (type == SOURCE_S) 228 if (type == SOURCE_S)
228 return prefix + "cc"; // Assembly files just get compiled by CC. 229 return prefix + "cc"; // Assembly files just get compiled by CC.
229 } 230 }
230 231
231 return std::string(); 232 return std::string();
232 } 233 }
OLDNEW
« no previous file with comments | « tools/gn/ninja_binary_target_writer_unittest.cc ('k') | tools/gn/ninja_script_target_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698