| 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 "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "tools/gn/filesystem_utils.h" | 8 #include "tools/gn/filesystem_utils.h" |
| 9 | 9 |
| 10 BuildSettings::BuildSettings() | 10 BuildSettings::BuildSettings() { |
| 11 : using_external_generator_(false), | |
| 12 item_tree_(), | |
| 13 target_manager_(this), | |
| 14 toolchain_manager_(this) { | |
| 15 } | 11 } |
| 16 | 12 |
| 17 BuildSettings::BuildSettings(const BuildSettings& other) | 13 BuildSettings::BuildSettings(const BuildSettings& other) |
| 18 : root_path_(other.root_path_), | 14 : root_path_(other.root_path_), |
| 19 root_path_utf8_(other.root_path_utf8_), | 15 root_path_utf8_(other.root_path_utf8_), |
| 20 secondary_source_path_(other.secondary_source_path_), | 16 secondary_source_path_(other.secondary_source_path_), |
| 21 using_external_generator_(other.using_external_generator_), | |
| 22 python_path_(other.python_path_), | 17 python_path_(other.python_path_), |
| 23 build_config_file_(other.build_config_file_), | 18 build_config_file_(other.build_config_file_), |
| 24 build_dir_(other.build_dir_), | 19 build_dir_(other.build_dir_), |
| 25 build_to_source_dir_string_(other.build_to_source_dir_string_), | 20 build_to_source_dir_string_(other.build_to_source_dir_string_), |
| 26 build_args_(other.build_args_), | 21 build_args_(other.build_args_) { |
| 27 target_resolved_callback_(), // Don't copy. | |
| 28 item_tree_(), | |
| 29 target_manager_(this), | |
| 30 toolchain_manager_(this) { | |
| 31 } | 22 } |
| 32 | 23 |
| 33 BuildSettings::~BuildSettings() { | 24 BuildSettings::~BuildSettings() { |
| 34 } | 25 } |
| 35 | 26 |
| 36 void BuildSettings::SetRootPath(const base::FilePath& r) { | 27 void BuildSettings::SetRootPath(const base::FilePath& r) { |
| 37 DCHECK(r.value()[r.value().size() - 1] != base::FilePath::kSeparators[0]); | 28 DCHECK(r.value()[r.value().size() - 1] != base::FilePath::kSeparators[0]); |
| 38 root_path_ = r; | 29 root_path_ = r; |
| 39 root_path_utf8_ = FilePathToUTF8(root_path_); | 30 root_path_utf8_ = FilePathToUTF8(root_path_); |
| 40 } | 31 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 59 base::FilePath BuildSettings::GetFullPathSecondary( | 50 base::FilePath BuildSettings::GetFullPathSecondary( |
| 60 const SourceFile& file) const { | 51 const SourceFile& file) const { |
| 61 return file.Resolve(secondary_source_path_); | 52 return file.Resolve(secondary_source_path_); |
| 62 } | 53 } |
| 63 | 54 |
| 64 base::FilePath BuildSettings::GetFullPathSecondary( | 55 base::FilePath BuildSettings::GetFullPathSecondary( |
| 65 const SourceDir& dir) const { | 56 const SourceDir& dir) const { |
| 66 return dir.Resolve(secondary_source_path_); | 57 return dir.Resolve(secondary_source_path_); |
| 67 } | 58 } |
| 68 | 59 |
| 60 void BuildSettings::ItemDefined(scoped_ptr<Item> item) const { |
| 61 DCHECK(item); |
| 62 if (!item_defined_callback_.is_null()) |
| 63 item_defined_callback_.Run(item.Pass()); |
| 64 } |
| OLD | NEW |