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 #include "tools/gn/setup.h" | 5 #include "tools/gn/setup.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 // Find the .gn file. | 267 // Find the .gn file. |
268 base::FilePath root_path; | 268 base::FilePath root_path; |
269 | 269 |
270 // Prefer the command line args to the config file. | 270 // Prefer the command line args to the config file. |
271 base::FilePath relative_root_path = cmdline.GetSwitchValuePath(kSwitchRoot); | 271 base::FilePath relative_root_path = cmdline.GetSwitchValuePath(kSwitchRoot); |
272 if (!relative_root_path.empty()) { | 272 if (!relative_root_path.empty()) { |
273 root_path = base::MakeAbsoluteFilePath(relative_root_path); | 273 root_path = base::MakeAbsoluteFilePath(relative_root_path); |
274 dotfile_name_ = root_path.Append(kGnFile); | 274 dotfile_name_ = root_path.Append(kGnFile); |
275 } else { | 275 } else { |
276 base::FilePath cur_dir; | 276 base::FilePath cur_dir; |
277 file_util::GetCurrentDirectory(&cur_dir); | 277 base::GetCurrentDirectory(&cur_dir); |
278 dotfile_name_ = FindDotFile(cur_dir); | 278 dotfile_name_ = FindDotFile(cur_dir); |
279 if (dotfile_name_.empty()) { | 279 if (dotfile_name_.empty()) { |
280 Err(Location(), "Can't find source root.", | 280 Err(Location(), "Can't find source root.", |
281 "I could not find a \".gn\" file in the current directory or any " | 281 "I could not find a \".gn\" file in the current directory or any " |
282 "parent,\nand the --root command-line argument was not specified.") | 282 "parent,\nand the --root command-line argument was not specified.") |
283 .PrintToStdout(); | 283 .PrintToStdout(); |
284 return false; | 284 return false; |
285 } | 285 } |
286 root_path = dotfile_name_.DirName(); | 286 root_path = dotfile_name_.DirName(); |
287 } | 287 } |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 } | 433 } |
434 | 434 |
435 void DependentSetup::RunPreMessageLoop() { | 435 void DependentSetup::RunPreMessageLoop() { |
436 CommonSetup::RunPreMessageLoop(); | 436 CommonSetup::RunPreMessageLoop(); |
437 } | 437 } |
438 | 438 |
439 bool DependentSetup::RunPostMessageLoop() { | 439 bool DependentSetup::RunPostMessageLoop() { |
440 return CommonSetup::RunPostMessageLoop(); | 440 return CommonSetup::RunPostMessageLoop(); |
441 } | 441 } |
442 | 442 |
OLD | NEW |