Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: tools/gn/setup.cc

Issue 630223002: gn: Support build directories outside the source tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include <sstream> 10 #include <sstream>
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 if (scheduler_.verbose_logging()) 434 if (scheduler_.verbose_logging())
435 scheduler_.Log("Using source root", FilePathToUTF8(root_path)); 435 scheduler_.Log("Using source root", FilePathToUTF8(root_path));
436 build_settings_.SetRootPath(root_path); 436 build_settings_.SetRootPath(root_path);
437 437
438 return true; 438 return true;
439 } 439 }
440 440
441 bool Setup::FillBuildDir(const std::string& build_dir, bool require_exists) { 441 bool Setup::FillBuildDir(const std::string& build_dir, bool require_exists) {
442 SourceDir resolved = 442 SourceDir resolved =
443 SourceDirForCurrentDirectory(build_settings_.root_path()). 443 SourceDirForCurrentDirectory(build_settings_.root_path()).
444 ResolveRelativeDir(build_dir); 444 ResolveRelativeDir(build_dir, build_settings_.root_path());
445 if (resolved.is_null()) { 445 if (resolved.is_null()) {
446 Err(Location(), "Couldn't resolve build directory.", 446 Err(Location(), "Couldn't resolve build directory.",
447 "The build directory supplied (\"" + build_dir + "\") was not valid."). 447 "The build directory supplied (\"" + build_dir + "\") was not valid.").
448 PrintToStdout(); 448 PrintToStdout();
449 return false; 449 return false;
450 } 450 }
451 451
452 if (scheduler_.verbose_logging()) 452 if (scheduler_.verbose_logging())
453 scheduler_.Log("Using build dir", resolved.value()); 453 scheduler_.Log("Using build dir", resolved.value());
454 454
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 546
547 // Root build file. 547 // Root build file.
548 const Value* root_value = dotfile_scope_.GetValue("root", true); 548 const Value* root_value = dotfile_scope_.GetValue("root", true);
549 if (root_value) { 549 if (root_value) {
550 if (!root_value->VerifyTypeIs(Value::STRING, &err)) { 550 if (!root_value->VerifyTypeIs(Value::STRING, &err)) {
551 err.PrintToStdout(); 551 err.PrintToStdout();
552 return false; 552 return false;
553 } 553 }
554 554
555 Label root_target_label = 555 Label root_target_label =
556 Label::Resolve(SourceDir("//"), Label(), *root_value, &err); 556 Label::Resolve(SourceDir("//"), Label(), *root_value,
557 build_settings_.root_path(), &err);
557 if (err.has_error()) { 558 if (err.has_error()) {
558 err.PrintToStdout(); 559 err.PrintToStdout();
559 return false; 560 return false;
560 } 561 }
561 562
562 root_build_file_ = Loader::BuildFileForLabel(root_target_label); 563 root_build_file_ = Loader::BuildFileForLabel(root_target_label);
563 } 564 }
564 565
565 // Build config file. 566 // Build config file.
566 const Value* build_config_value = 567 const Value* build_config_value =
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 } 605 }
605 606
606 void DependentSetup::RunPreMessageLoop() { 607 void DependentSetup::RunPreMessageLoop() {
607 CommonSetup::RunPreMessageLoop(); 608 CommonSetup::RunPreMessageLoop();
608 } 609 }
609 610
610 bool DependentSetup::RunPostMessageLoop() { 611 bool DependentSetup::RunPostMessageLoop() {
611 return CommonSetup::RunPostMessageLoop(); 612 return CommonSetup::RunPostMessageLoop();
612 } 613 }
613 614
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698