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 #ifndef TOOLS_GN_SETTINGS_H_ | 5 #ifndef TOOLS_GN_SETTINGS_H_ |
6 #define TOOLS_GN_SETTINGS_H_ | 6 #define TOOLS_GN_SETTINGS_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "tools/gn/build_settings.h" | 9 #include "tools/gn/build_settings.h" |
10 #include "tools/gn/import_manager.h" | 10 #include "tools/gn/import_manager.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 // toolchain should use an empty string. | 39 // toolchain should use an empty string. |
40 Settings(const BuildSettings* build_settings, | 40 Settings(const BuildSettings* build_settings, |
41 const std::string& output_subdir_name); | 41 const std::string& output_subdir_name); |
42 ~Settings(); | 42 ~Settings(); |
43 | 43 |
44 const BuildSettings* build_settings() const { return build_settings_; } | 44 const BuildSettings* build_settings() const { return build_settings_; } |
45 | 45 |
46 const Label& toolchain_label() const { return toolchain_label_; } | 46 const Label& toolchain_label() const { return toolchain_label_; } |
47 void set_toolchain_label(const Label& l) { toolchain_label_ = l; } | 47 void set_toolchain_label(const Label& l) { toolchain_label_ = l; } |
48 | 48 |
| 49 const Label& default_toolchain_label() const { |
| 50 return default_toolchain_label_; |
| 51 } |
| 52 void set_default_toolchain_label(const Label& default_label) { |
| 53 default_toolchain_label_ = default_label; |
| 54 } |
| 55 |
49 // Indicates if this corresponds to the default toolchain. | 56 // Indicates if this corresponds to the default toolchain. |
50 bool is_default() const { return is_default_; } | 57 bool is_default() const { |
51 void set_is_default(bool id) { is_default_ = id; } | 58 return toolchain_label_ == default_toolchain_label_; |
| 59 } |
52 | 60 |
53 bool IsMac() const { return target_os_ == MAC; } | 61 bool IsMac() const { return target_os_ == MAC; } |
54 bool IsLinux() const { return target_os_ == LINUX; } | 62 bool IsLinux() const { return target_os_ == LINUX; } |
55 bool IsWin() const { return target_os_ == WIN; } | 63 bool IsWin() const { return target_os_ == WIN; } |
56 | 64 |
57 TargetOS target_os() const { return target_os_; } | 65 TargetOS target_os() const { return target_os_; } |
58 void set_target_os(TargetOS t) { target_os_ = t; } | 66 void set_target_os(TargetOS t) { target_os_ = t; } |
59 | 67 |
60 const OutputFile& toolchain_output_subdir() const { | 68 const OutputFile& toolchain_output_subdir() const { |
61 return toolchain_output_subdir_; | 69 return toolchain_output_subdir_; |
(...skipping 25 matching lines...) Expand all Loading... |
87 return greedy_target_generation_; | 95 return greedy_target_generation_; |
88 } | 96 } |
89 void set_greedy_target_generation(bool gtg) { | 97 void set_greedy_target_generation(bool gtg) { |
90 greedy_target_generation_ = gtg; | 98 greedy_target_generation_ = gtg; |
91 } | 99 } |
92 | 100 |
93 private: | 101 private: |
94 const BuildSettings* build_settings_; | 102 const BuildSettings* build_settings_; |
95 | 103 |
96 Label toolchain_label_; | 104 Label toolchain_label_; |
97 bool is_default_; | 105 Label default_toolchain_label_; |
98 | 106 |
99 TargetOS target_os_; | 107 TargetOS target_os_; |
100 | 108 |
101 mutable ImportManager import_manager_; | 109 mutable ImportManager import_manager_; |
102 | 110 |
103 // The subdirectory inside the build output for this toolchain. For the | 111 // The subdirectory inside the build output for this toolchain. For the |
104 // default toolchain, this will be empty (since the deafult toolchain's | 112 // default toolchain, this will be empty (since the deafult toolchain's |
105 // output directory is the same as the build directory). When nonempty, this | 113 // output directory is the same as the build directory). When nonempty, this |
106 // is guaranteed to end in a slash. | 114 // is guaranteed to end in a slash. |
107 OutputFile toolchain_output_subdir_; | 115 OutputFile toolchain_output_subdir_; |
108 | 116 |
109 // Full source file path to the toolchain output directory. | 117 // Full source file path to the toolchain output directory. |
110 SourceDir toolchain_output_dir_; | 118 SourceDir toolchain_output_dir_; |
111 | 119 |
112 SourceDir toolchain_gen_dir_; | 120 SourceDir toolchain_gen_dir_; |
113 | 121 |
114 Scope base_config_; | 122 Scope base_config_; |
115 | 123 |
116 bool greedy_target_generation_; | 124 bool greedy_target_generation_; |
117 | 125 |
118 DISALLOW_COPY_AND_ASSIGN(Settings); | 126 DISALLOW_COPY_AND_ASSIGN(Settings); |
119 }; | 127 }; |
120 | 128 |
121 #endif // TOOLS_GN_SETTINGS_H_ | 129 #endif // TOOLS_GN_SETTINGS_H_ |
OLD | NEW |