OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "tools/gn/settings.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "tools/gn/filesystem_utils.h" | |
9 | |
10 Settings::Settings(const BuildSettings* build_settings, | |
11 const Toolchain* toolchain, | |
12 const std::string& output_subdir_name) | |
13 : build_settings_(build_settings), | |
14 toolchain_(toolchain), | |
15 target_os_(WIN), // FIXME(brettw) set this properly. | |
16 import_manager_(), | |
17 base_config_(this) { | |
18 DCHECK(output_subdir_name.find('/') == std::string::npos); | |
19 if (output_subdir_name.empty()) { | |
20 toolchain_output_dir_ = build_settings->build_dir(); | |
21 } else { | |
22 // We guarantee this ends in a slash. | |
23 toolchain_output_subdir_.value().append(output_subdir_name); | |
24 toolchain_output_subdir_.value().push_back('/'); | |
25 | |
26 toolchain_output_dir_ = SourceDir(build_settings->build_dir().value() + | |
27 toolchain_output_subdir_.value()); | |
28 } | |
29 // The output dir will be null in some tests and when invoked to parsed | |
30 // one-off data without doing generation. | |
31 if (!toolchain_output_dir_.is_null()) | |
32 toolchain_gen_dir_ = SourceDir(toolchain_output_dir_.value() + "gen/"); | |
33 } | |
34 | |
35 Settings::~Settings() { | |
36 } | |
37 | |
38 | |
OLD | NEW |