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/settings.h" | 5 #include "tools/gn/settings.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "tools/gn/filesystem_utils.h" | 9 #include "tools/gn/filesystem_utils.h" |
10 | 10 |
11 Settings::Settings(const BuildSettings* build_settings, | 11 Settings::Settings(const BuildSettings* build_settings, |
12 const std::string& output_subdir_name) | 12 const std::string& output_subdir_name) |
13 : build_settings_(build_settings), | 13 : build_settings_(build_settings), |
14 import_manager_(), | 14 import_manager_(), |
15 base_config_(this), | 15 base_config_(this, {}), |
16 greedy_target_generation_(false) { | 16 greedy_target_generation_(false) { |
| 17 base_config_.AddSourceFile(build_settings->build_config_file()); |
17 if (output_subdir_name.empty()) { | 18 if (output_subdir_name.empty()) { |
18 toolchain_output_dir_ = build_settings->build_dir(); | 19 toolchain_output_dir_ = build_settings->build_dir(); |
19 } else { | 20 } else { |
20 // We guarantee this ends in a slash. | 21 // We guarantee this ends in a slash. |
21 DCHECK(output_subdir_name[output_subdir_name.size() - 1] == '/'); | 22 DCHECK(output_subdir_name[output_subdir_name.size() - 1] == '/'); |
22 toolchain_output_subdir_.value().append(output_subdir_name); | 23 toolchain_output_subdir_.value().append(output_subdir_name); |
23 | 24 |
24 DCHECK(!build_settings->build_dir().is_null()); | 25 DCHECK(!build_settings->build_dir().is_null()); |
25 toolchain_output_dir_ = SourceDir(build_settings->build_dir().value() + | 26 toolchain_output_dir_ = SourceDir(build_settings->build_dir().value() + |
26 toolchain_output_subdir_.value()); | 27 toolchain_output_subdir_.value()); |
27 } | 28 } |
28 // The output dir will be null in some tests and when invoked to parsed | 29 // The output dir will be null in some tests and when invoked to parsed |
29 // one-off data without doing generation. | 30 // one-off data without doing generation. |
30 if (!toolchain_output_dir_.is_null()) | 31 if (!toolchain_output_dir_.is_null()) |
31 toolchain_gen_dir_ = SourceDir(toolchain_output_dir_.value() + "gen/"); | 32 toolchain_gen_dir_ = SourceDir(toolchain_output_dir_.value() + "gen/"); |
32 } | 33 } |
33 | 34 |
34 Settings::~Settings() { | 35 Settings::~Settings() { |
35 } | 36 } |
OLD | NEW |