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/build_settings.h" | 5 #include "tools/gn/build_settings.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "tools/gn/filesystem_utils.h" | 10 #include "tools/gn/filesystem_utils.h" |
11 | 11 |
12 BuildSettings::BuildSettings() { | 12 BuildSettings::BuildSettings() { |
13 } | 13 } |
14 | 14 |
15 BuildSettings::BuildSettings(const BuildSettings& other) | 15 BuildSettings::BuildSettings(const BuildSettings& other) |
16 : root_path_(other.root_path_), | 16 : root_path_(other.root_path_), |
17 root_path_utf8_(other.root_path_utf8_), | 17 root_path_utf8_(other.root_path_utf8_), |
18 secondary_source_path_(other.secondary_source_path_), | 18 secondary_source_path_(other.secondary_source_path_), |
19 python_path_(other.python_path_), | 19 python_path_(other.python_path_), |
20 build_config_file_(other.build_config_file_), | 20 build_config_file_(other.build_config_file_), |
21 arg_file_template_path_(other.arg_file_template_path_), | 21 arg_file_template_path_(other.arg_file_template_path_), |
22 build_dir_(other.build_dir_), | 22 build_dir_(other.build_dir_), |
23 build_args_(other.build_args_) {} | 23 build_args_(other.build_args_) {} |
24 | 24 |
25 BuildSettings::~BuildSettings() { | 25 BuildSettings::~BuildSettings() { |
26 } | 26 } |
27 | 27 |
| 28 void BuildSettings::SetRootTargetLabel(const Label& r) { |
| 29 root_target_label_ = r; |
| 30 } |
| 31 |
28 void BuildSettings::SetRootPath(const base::FilePath& r) { | 32 void BuildSettings::SetRootPath(const base::FilePath& r) { |
29 DCHECK(r.value()[r.value().size() - 1] != base::FilePath::kSeparators[0]); | 33 DCHECK(r.value()[r.value().size() - 1] != base::FilePath::kSeparators[0]); |
30 root_path_ = r.NormalizePathSeparatorsTo('/'); | 34 root_path_ = r.NormalizePathSeparatorsTo('/'); |
31 root_path_utf8_ = FilePathToUTF8(root_path_); | 35 root_path_utf8_ = FilePathToUTF8(root_path_); |
32 } | 36 } |
33 | 37 |
34 void BuildSettings::SetSecondarySourcePath(const SourceDir& d) { | 38 void BuildSettings::SetSecondarySourcePath(const SourceDir& d) { |
35 secondary_source_path_ = GetFullPath(d).NormalizePathSeparatorsTo('/'); | 39 secondary_source_path_ = GetFullPath(d).NormalizePathSeparatorsTo('/'); |
36 } | 40 } |
37 | 41 |
(...skipping 17 matching lines...) Expand all Loading... |
55 base::FilePath BuildSettings::GetFullPathSecondary( | 59 base::FilePath BuildSettings::GetFullPathSecondary( |
56 const SourceDir& dir) const { | 60 const SourceDir& dir) const { |
57 return dir.Resolve(secondary_source_path_).NormalizePathSeparatorsTo('/'); | 61 return dir.Resolve(secondary_source_path_).NormalizePathSeparatorsTo('/'); |
58 } | 62 } |
59 | 63 |
60 void BuildSettings::ItemDefined(std::unique_ptr<Item> item) const { | 64 void BuildSettings::ItemDefined(std::unique_ptr<Item> item) const { |
61 DCHECK(item); | 65 DCHECK(item); |
62 if (!item_defined_callback_.is_null()) | 66 if (!item_defined_callback_.is_null()) |
63 item_defined_callback_.Run(std::move(item)); | 67 item_defined_callback_.Run(std::move(item)); |
64 } | 68 } |
OLD | NEW |