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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 // Helper class to setup the build settings and environment for the various | 72 // Helper class to setup the build settings and environment for the various |
73 // commands to run. | 73 // commands to run. |
74 class Setup : public CommonSetup { | 74 class Setup : public CommonSetup { |
75 public: | 75 public: |
76 Setup(); | 76 Setup(); |
77 virtual ~Setup(); | 77 virtual ~Setup(); |
78 | 78 |
79 // Configures the build for the current command line. On success returns | 79 // Configures the build for the current command line. On success returns |
80 // true. On failure, prints the error and returns false. | 80 // true. On failure, prints the error and returns false. |
81 bool DoSetup(); | 81 // |
| 82 // The parameter is the string the user specified for the build directory. We |
| 83 // will try to interpret this as a SourceDir if possible, and will fail if is |
| 84 // is malformed. |
| 85 bool DoSetup(const std::string& build_dir); |
82 | 86 |
83 // Runs the load, returning true on success. On failure, prints the error | 87 // Runs the load, returning true on success. On failure, prints the error |
84 // and returns false. This includes both RunPreMessageLoop() and | 88 // and returns false. This includes both RunPreMessageLoop() and |
85 // RunPostMessageLoop(). | 89 // RunPostMessageLoop(). |
86 bool Run(); | 90 bool Run(); |
87 | 91 |
88 Scheduler& scheduler() { return scheduler_; } | 92 Scheduler& scheduler() { return scheduler_; } |
89 | 93 |
90 virtual Scheduler* GetScheduler() OVERRIDE; | 94 virtual Scheduler* GetScheduler() OVERRIDE; |
91 | 95 |
92 private: | 96 private: |
93 // Fills build arguments. Returns true on success. | 97 // Fills build arguments. Returns true on success. |
94 bool FillArguments(const CommandLine& cmdline); | 98 bool FillArguments(const CommandLine& cmdline); |
95 | 99 |
96 // Fills the root directory into the settings. Returns true on success. | 100 // Fills the root directory into the settings. Returns true on success. |
97 bool FillSourceDir(const CommandLine& cmdline); | 101 bool FillSourceDir(const CommandLine& cmdline); |
98 | 102 |
| 103 // Fills the build directory given the value the user has specified. |
| 104 // Must happen after FillSourceDir so we can resolve source-relative |
| 105 // paths. |
| 106 bool FillBuildDir(const std::string& build_dir); |
| 107 |
99 // Fills the python path portion of the command line. On failure, sets | 108 // Fills the python path portion of the command line. On failure, sets |
100 // it to just "python". | 109 // it to just "python". |
101 void FillPythonPath(); | 110 void FillPythonPath(); |
102 | 111 |
103 // Run config file. | 112 // Run config file. |
104 bool RunConfigFile(); | 113 bool RunConfigFile(); |
105 | 114 |
106 bool FillOtherConfig(const CommandLine& cmdline); | 115 bool FillOtherConfig(const CommandLine& cmdline); |
107 | 116 |
108 Scheduler scheduler_; | 117 Scheduler scheduler_; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 void RunPreMessageLoop(); | 161 void RunPreMessageLoop(); |
153 bool RunPostMessageLoop(); | 162 bool RunPostMessageLoop(); |
154 | 163 |
155 virtual Scheduler* GetScheduler() OVERRIDE; | 164 virtual Scheduler* GetScheduler() OVERRIDE; |
156 | 165 |
157 private: | 166 private: |
158 Scheduler* scheduler_; | 167 Scheduler* scheduler_; |
159 }; | 168 }; |
160 | 169 |
161 #endif // TOOLS_GN_SETUP_H_ | 170 #endif // TOOLS_GN_SETUP_H_ |
OLD | NEW |