| 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 10 matching lines...) Expand all Loading... |
| 21 // use it from multiple threads during target generation without locking (which | 21 // use it from multiple threads during target generation without locking (which |
| 22 // is important, because it gets used a lot). | 22 // is important, because it gets used a lot). |
| 23 // | 23 // |
| 24 // The Toolchain object holds the set of stuff that is set by the toolchain | 24 // The Toolchain object holds the set of stuff that is set by the toolchain |
| 25 // declaration, which obviously needs to be set later when we actually parse | 25 // declaration, which obviously needs to be set later when we actually parse |
| 26 // the file with the toolchain declaration in it. | 26 // the file with the toolchain declaration in it. |
| 27 class Settings { | 27 class Settings { |
| 28 public: | 28 public: |
| 29 enum TargetOS { | 29 enum TargetOS { |
| 30 UNKNOWN, | 30 UNKNOWN, |
| 31 FREEBSD, |
| 31 LINUX, | 32 LINUX, |
| 32 MAC, | 33 MAC, |
| 33 WIN | 34 WIN |
| 34 }; | 35 }; |
| 35 | 36 |
| 36 // Constructs a toolchain settings. The output_subdir_name is the name we | 37 // Constructs a toolchain settings. The output_subdir_name is the name we |
| 37 // should use for the subdirectory in the build output directory for this | 38 // should use for the subdirectory in the build output directory for this |
| 38 // toolchain's outputs. It should have no slashes in it. The default | 39 // toolchain's outputs. It should have no slashes in it. The default |
| 39 // toolchain should use an empty string. | 40 // toolchain should use an empty string. |
| 40 Settings(const BuildSettings* build_settings, | 41 Settings(const BuildSettings* build_settings, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 53 default_toolchain_label_ = default_label; | 54 default_toolchain_label_ = default_label; |
| 54 } | 55 } |
| 55 | 56 |
| 56 // Indicates if this corresponds to the default toolchain. | 57 // Indicates if this corresponds to the default toolchain. |
| 57 bool is_default() const { | 58 bool is_default() const { |
| 58 return toolchain_label_ == default_toolchain_label_; | 59 return toolchain_label_ == default_toolchain_label_; |
| 59 } | 60 } |
| 60 | 61 |
| 61 bool IsMac() const { return target_os_ == MAC; } | 62 bool IsMac() const { return target_os_ == MAC; } |
| 62 bool IsLinux() const { return target_os_ == LINUX; } | 63 bool IsLinux() const { return target_os_ == LINUX; } |
| 64 bool IsFreeBSD() const { return target_os_ == FREEBSD; } |
| 63 bool IsWin() const { return target_os_ == WIN; } | 65 bool IsWin() const { return target_os_ == WIN; } |
| 64 | 66 |
| 65 TargetOS target_os() const { return target_os_; } | 67 TargetOS target_os() const { return target_os_; } |
| 66 void set_target_os(TargetOS t) { target_os_ = t; } | 68 void set_target_os(TargetOS t) { target_os_ = t; } |
| 67 | 69 |
| 68 const OutputFile& toolchain_output_subdir() const { | 70 const OutputFile& toolchain_output_subdir() const { |
| 69 return toolchain_output_subdir_; | 71 return toolchain_output_subdir_; |
| 70 } | 72 } |
| 71 const SourceDir& toolchain_output_dir() const { | 73 const SourceDir& toolchain_output_dir() const { |
| 72 return toolchain_output_dir_; | 74 return toolchain_output_dir_; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 SourceDir toolchain_gen_dir_; | 122 SourceDir toolchain_gen_dir_; |
| 121 | 123 |
| 122 Scope base_config_; | 124 Scope base_config_; |
| 123 | 125 |
| 124 bool greedy_target_generation_; | 126 bool greedy_target_generation_; |
| 125 | 127 |
| 126 DISALLOW_COPY_AND_ASSIGN(Settings); | 128 DISALLOW_COPY_AND_ASSIGN(Settings); |
| 127 }; | 129 }; |
| 128 | 130 |
| 129 #endif // TOOLS_GN_SETTINGS_H_ | 131 #endif // TOOLS_GN_SETTINGS_H_ |
| OLD | NEW |