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 bool check_for_bad_items_; | 74 bool check_for_bad_items_; |
69 bool check_for_unused_overrides_; | 75 bool check_for_unused_overrides_; |
| 76 bool check_public_headers_; |
70 | 77 |
71 private: | 78 private: |
72 CommonSetup& operator=(const CommonSetup& other); // Disallow. | 79 CommonSetup& operator=(const CommonSetup& other); // Disallow. |
73 }; | 80 }; |
74 | 81 |
75 // Helper class to setup the build settings and environment for the various | 82 // Helper class to setup the build settings and environment for the various |
76 // commands to run. | 83 // commands to run. |
77 class Setup : public CommonSetup { | 84 class Setup : public CommonSetup { |
78 public: | 85 public: |
79 Setup(); | 86 Setup(); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 void RunPreMessageLoop(); | 171 void RunPreMessageLoop(); |
165 bool RunPostMessageLoop(); | 172 bool RunPostMessageLoop(); |
166 | 173 |
167 virtual Scheduler* GetScheduler() OVERRIDE; | 174 virtual Scheduler* GetScheduler() OVERRIDE; |
168 | 175 |
169 private: | 176 private: |
170 Scheduler* scheduler_; | 177 Scheduler* scheduler_; |
171 }; | 178 }; |
172 | 179 |
173 #endif // TOOLS_GN_SETUP_H_ | 180 #endif // TOOLS_GN_SETUP_H_ |
OLD | NEW |