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

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

Issue 34603009: Improve Windows GN build setup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « tools/gn/build_settings.h ('k') | tools/gn/ninja_binary_target_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/build_settings.h" 5 #include "tools/gn/build_settings.h"
6 6
7 #include "base/file_util.h"
7 #include "tools/gn/filesystem_utils.h" 8 #include "tools/gn/filesystem_utils.h"
8 9
9 BuildSettings::BuildSettings() 10 BuildSettings::BuildSettings()
10 : using_external_generator_(false), 11 : using_external_generator_(false),
11 item_tree_(), 12 item_tree_(),
12 target_manager_(this), 13 target_manager_(this),
13 toolchain_manager_(this) { 14 toolchain_manager_(this) {
14 } 15 }
15 16
16 BuildSettings::BuildSettings(const BuildSettings& other) 17 BuildSettings::BuildSettings(const BuildSettings& other)
(...skipping 21 matching lines...) Expand all
38 root_path_utf8_ = FilePathToUTF8(root_path_); 39 root_path_utf8_ = FilePathToUTF8(root_path_);
39 } 40 }
40 41
41 void BuildSettings::SetSecondarySourcePath(const SourceDir& d) { 42 void BuildSettings::SetSecondarySourcePath(const SourceDir& d) {
42 secondary_source_path_ = GetFullPath(d); 43 secondary_source_path_ = GetFullPath(d);
43 } 44 }
44 45
45 void BuildSettings::SetBuildDir(const SourceDir& d) { 46 void BuildSettings::SetBuildDir(const SourceDir& d) {
46 build_dir_ = d; 47 build_dir_ = d;
47 build_to_source_dir_string_ = InvertDir(d); 48 build_to_source_dir_string_ = InvertDir(d);
49
50 DCHECK(!root_path_.empty());
51 file_util::CreateDirectory(build_dir_.Resolve(root_path_));
48 } 52 }
49 53
50 base::FilePath BuildSettings::GetFullPath(const SourceFile& file) const { 54 base::FilePath BuildSettings::GetFullPath(const SourceFile& file) const {
51 return file.Resolve(root_path_); 55 return file.Resolve(root_path_);
52 } 56 }
53 57
54 base::FilePath BuildSettings::GetFullPath(const SourceDir& dir) const { 58 base::FilePath BuildSettings::GetFullPath(const SourceDir& dir) const {
55 return dir.Resolve(root_path_); 59 return dir.Resolve(root_path_);
56 } 60 }
57 61
58 base::FilePath BuildSettings::GetFullPathSecondary( 62 base::FilePath BuildSettings::GetFullPathSecondary(
59 const SourceFile& file) const { 63 const SourceFile& file) const {
60 return file.Resolve(secondary_source_path_); 64 return file.Resolve(secondary_source_path_);
61 } 65 }
62 66
63 base::FilePath BuildSettings::GetFullPathSecondary( 67 base::FilePath BuildSettings::GetFullPathSecondary(
64 const SourceDir& dir) const { 68 const SourceDir& dir) const {
65 return dir.Resolve(secondary_source_path_); 69 return dir.Resolve(secondary_source_path_);
66 } 70 }
67 71
OLDNEW
« no previous file with comments | « tools/gn/build_settings.h ('k') | tools/gn/ninja_binary_target_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698