| 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_SETUP_H_ | 5 #ifndef TOOLS_GN_SETUP_H_ |
| 6 #define TOOLS_GN_SETUP_H_ | 6 #define TOOLS_GN_SETUP_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // When true (the default), Run() will check for unresolved dependencies and | 41 // When true (the default), Run() will check for unresolved dependencies and |
| 42 // cycles upon completion. When false, such errors will be ignored. | 42 // cycles upon completion. When false, such errors will be ignored. |
| 43 void set_check_for_bad_items(bool s) { check_for_bad_items_ = s; } | 43 void set_check_for_bad_items(bool s) { check_for_bad_items_ = s; } |
| 44 | 44 |
| 45 // When true (the default), RunPostMessageLoop will check for overrides that | 45 // When true (the default), RunPostMessageLoop will check for overrides that |
| 46 // were specified but not used. When false, such errors will be ignored. | 46 // were specified but not used. When false, such errors will be ignored. |
| 47 void set_check_for_unused_overrides(bool s) { | 47 void set_check_for_unused_overrides(bool s) { |
| 48 check_for_unused_overrides_ = s; | 48 check_for_unused_overrides_ = s; |
| 49 } | 49 } |
| 50 | 50 |
| 51 // After a successful run, setting this will additionally cause the public |
| 52 // headers to be checked. Defaults to false. |
| 53 void set_check_public_headers(bool s) { |
| 54 check_public_headers_ = s; |
| 55 } |
| 56 |
| 51 BuildSettings& build_settings() { return build_settings_; } | 57 BuildSettings& build_settings() { return build_settings_; } |
| 52 Builder* builder() { return builder_.get(); } | 58 Builder* builder() { return builder_.get(); } |
| 53 LoaderImpl* loader() { return loader_.get(); } | 59 LoaderImpl* loader() { return loader_.get(); } |
| 54 | 60 |
| 55 protected: | 61 protected: |
| 56 CommonSetup(); | 62 CommonSetup(); |
| 57 CommonSetup(const CommonSetup& other); | 63 CommonSetup(const CommonSetup& other); |
| 58 | 64 |
| 59 // Performs the two sets of operations to run the generation before and after | 65 // Performs the two sets of operations to run the generation before and after |
| 60 // the message loop is run. | 66 // the message loop is run. |
| 61 void RunPreMessageLoop(); | 67 void RunPreMessageLoop(); |
| 62 bool RunPostMessageLoop(); | 68 bool RunPostMessageLoop(); |
| 63 | 69 |
| 64 BuildSettings build_settings_; | 70 BuildSettings build_settings_; |
| 65 scoped_refptr<LoaderImpl> loader_; | 71 scoped_refptr<LoaderImpl> loader_; |
| 66 scoped_refptr<Builder> builder_; | 72 scoped_refptr<Builder> builder_; |
| 67 | 73 |
| 68 SourceFile root_build_file_; | 74 SourceFile root_build_file_; |
| 69 | 75 |
| 70 bool check_for_bad_items_; | 76 bool check_for_bad_items_; |
| 71 bool check_for_unused_overrides_; | 77 bool check_for_unused_overrides_; |
| 78 bool check_public_headers_; |
| 72 | 79 |
| 73 private: | 80 private: |
| 74 CommonSetup& operator=(const CommonSetup& other); // Disallow. | 81 CommonSetup& operator=(const CommonSetup& other); // Disallow. |
| 75 }; | 82 }; |
| 76 | 83 |
| 77 // Helper class to setup the build settings and environment for the various | 84 // Helper class to setup the build settings and environment for the various |
| 78 // commands to run. | 85 // commands to run. |
| 79 class Setup : public CommonSetup { | 86 class Setup : public CommonSetup { |
| 80 public: | 87 public: |
| 81 Setup(); | 88 Setup(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 void RunPreMessageLoop(); | 173 void RunPreMessageLoop(); |
| 167 bool RunPostMessageLoop(); | 174 bool RunPostMessageLoop(); |
| 168 | 175 |
| 169 virtual Scheduler* GetScheduler() OVERRIDE; | 176 virtual Scheduler* GetScheduler() OVERRIDE; |
| 170 | 177 |
| 171 private: | 178 private: |
| 172 Scheduler* scheduler_; | 179 Scheduler* scheduler_; |
| 173 }; | 180 }; |
| 174 | 181 |
| 175 #endif // TOOLS_GN_SETUP_H_ | 182 #endif // TOOLS_GN_SETUP_H_ |
| OLD | NEW |