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

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

Issue 21983003: Make the Mac build work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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"
11 11
12 namespace { 12 namespace {
13 13
14 const char kLibDirWithSlash[] = "lib"; 14 const char kLibDirWithSlash[] = "lib/";
scottmg 2013/08/05 12:24:48 heh
15 const char kObjectDirNoSlash[] = "obj"; 15 const char kObjectDirNoSlash[] = "obj";
16 16
17 } // namespace 17 } // namespace
18 18
19 NinjaHelper::NinjaHelper(const BuildSettings* build_settings) 19 NinjaHelper::NinjaHelper(const BuildSettings* build_settings)
20 : build_settings_(build_settings) { 20 : build_settings_(build_settings) {
21 build_to_src_no_last_slash_ = build_settings->build_to_source_dir_string(); 21 build_to_src_no_last_slash_ = build_settings->build_to_source_dir_string();
22 if (!build_to_src_no_last_slash_.empty() && 22 if (!build_to_src_no_last_slash_.empty() &&
23 build_to_src_no_last_slash_[build_to_src_no_last_slash_.size() - 1] == 23 build_to_src_no_last_slash_[build_to_src_no_last_slash_.size() - 1] ==
24 '/') 24 '/')
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 OutputFile NinjaHelper::GetTargetOutputFile(const Target* target) const { 110 OutputFile NinjaHelper::GetTargetOutputFile(const Target* target) const {
111 OutputFile ret; 111 OutputFile ret;
112 if (target->output_type() == Target::NONE) { 112 if (target->output_type() == Target::NONE) {
113 NOTREACHED(); 113 NOTREACHED();
114 return ret; 114 return ret;
115 } 115 }
116 116
117 // This is prepended to the output file name. 117 // This is prepended to the output file name.
118 const char* prefix; 118 const char* prefix;
119 if (target->settings()->IsWin()) { 119 if (!target->settings()->IsWin() &&
120 target->output_type() == Target::SHARED_LIBRARY)
121 prefix = "lib";
122 else
120 prefix = ""; 123 prefix = "";
121 } else {
122 prefix = "lib";
123 }
124 124
125 const char* extension; 125 const char* extension;
126 if (target->output_type() == Target::NONE || 126 if (target->output_type() == Target::NONE ||
127 target->output_type() == Target::COPY_FILES || 127 target->output_type() == Target::COPY_FILES ||
128 target->output_type() == Target::CUSTOM) { 128 target->output_type() == Target::CUSTOM) {
129 extension = "stamp"; 129 extension = "stamp";
130 } else { 130 } else {
131 extension = GetExtensionForOutputType(target->output_type(), 131 extension = GetExtensionForOutputType(target->output_type(),
132 target->settings()->target_os()); 132 target->settings()->target_os());
133 } 133 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 ret.value().append(kObjectDirNoSlash); 172 ret.value().append(kObjectDirNoSlash);
173 AppendStringPiece(&ret.value(), 173 AppendStringPiece(&ret.value(),
174 target->label().dir().SourceAbsoluteWithOneSlash()); 174 target->label().dir().SourceAbsoluteWithOneSlash());
175 ret.value().append(target->label().name()); 175 ret.value().append(target->label().name());
176 if (extension[0]) { 176 if (extension[0]) {
177 ret.value().push_back('.'); 177 ret.value().push_back('.');
178 ret.value().append(extension); 178 ret.value().append(extension);
179 } 179 }
180 return ret; 180 return ret;
181 } 181 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698