OLD | NEW |
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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::EXECUTABLE) { | 120 (target->output_type() == Target::SHARED_LIBRARY || |
| 121 target->output_type() == Target::STATIC_LIBRARY)) |
| 122 prefix = "lib"; |
| 123 else |
121 prefix = ""; | 124 prefix = ""; |
122 } else { | |
123 prefix = "lib"; | |
124 } | |
125 | 125 |
126 const char* extension; | 126 const char* extension; |
127 if (target->output_type() == Target::NONE || | 127 if (target->output_type() == Target::NONE || |
128 target->output_type() == Target::COPY_FILES || | 128 target->output_type() == Target::COPY_FILES || |
129 target->output_type() == Target::CUSTOM) { | 129 target->output_type() == Target::CUSTOM) { |
130 extension = "stamp"; | 130 extension = "stamp"; |
131 } else { | 131 } else { |
132 extension = GetExtensionForOutputType(target->output_type(), | 132 extension = GetExtensionForOutputType(target->output_type(), |
133 target->settings()->target_os()); | 133 target->settings()->target_os()); |
134 } | 134 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 ret.value().append(kObjectDirNoSlash); | 173 ret.value().append(kObjectDirNoSlash); |
174 AppendStringPiece(&ret.value(), | 174 AppendStringPiece(&ret.value(), |
175 target->label().dir().SourceAbsoluteWithOneSlash()); | 175 target->label().dir().SourceAbsoluteWithOneSlash()); |
176 ret.value().append(target->label().name()); | 176 ret.value().append(target->label().name()); |
177 if (extension[0]) { | 177 if (extension[0]) { |
178 ret.value().push_back('.'); | 178 ret.value().push_back('.'); |
179 ret.value().append(extension); | 179 ret.value().append(extension); |
180 } | 180 } |
181 return ret; | 181 return ret; |
182 } | 182 } |
OLD | NEW |