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" |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 const char kLibDirWithSlash[] = "lib/"; | 14 const char kLibDirWithSlash[] = "lib/"; |
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 '/') |
25 build_to_src_no_last_slash_.resize(build_to_src_no_last_slash_.size() - 1); | 25 build_to_src_no_last_slash_.resize(build_to_src_no_last_slash_.size() - 1); |
26 | 26 |
27 build_to_src_system_no_last_slash_ = build_to_src_no_last_slash_; | 27 build_to_src_system_no_last_slash_ = build_to_src_no_last_slash_; |
28 ConvertPathToSystem(&build_to_src_system_no_last_slash_); | |
29 } | 28 } |
30 | 29 |
31 NinjaHelper::~NinjaHelper() { | 30 NinjaHelper::~NinjaHelper() { |
32 } | 31 } |
33 | 32 |
34 std::string NinjaHelper::GetTopleveOutputDir() const { | 33 std::string NinjaHelper::GetTopleveOutputDir() const { |
35 return kObjectDirNoSlash; | 34 return kObjectDirNoSlash; |
36 } | 35 } |
37 | 36 |
38 std::string NinjaHelper::GetTargetOutputDir(const Target* target) const { | 37 std::string NinjaHelper::GetTargetOutputDir(const Target* target) const { |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 if (settings->IsWin()) { | 225 if (settings->IsWin()) { |
227 if (type == SOURCE_RC) | 226 if (type == SOURCE_RC) |
228 return prefix + "rc"; | 227 return prefix + "rc"; |
229 } else { | 228 } else { |
230 if (type == SOURCE_S) | 229 if (type == SOURCE_S) |
231 return prefix + "cc"; // Assembly files just get compiled by CC. | 230 return prefix + "cc"; // Assembly files just get compiled by CC. |
232 } | 231 } |
233 | 232 |
234 return std::string(); | 233 return std::string(); |
235 } | 234 } |
OLD | NEW |