| 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/build_settings.h" | 5 #include "tools/gn/build_settings.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "tools/gn/filesystem_utils.h" | 8 #include "tools/gn/filesystem_utils.h" |
| 9 | 9 |
| 10 BuildSettings::BuildSettings() | 10 BuildSettings::BuildSettings() |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 root_path_utf8_ = FilePathToUTF8(root_path_); | 39 root_path_utf8_ = FilePathToUTF8(root_path_); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void BuildSettings::SetSecondarySourcePath(const SourceDir& d) { | 42 void BuildSettings::SetSecondarySourcePath(const SourceDir& d) { |
| 43 secondary_source_path_ = GetFullPath(d); | 43 secondary_source_path_ = GetFullPath(d); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void BuildSettings::SetBuildDir(const SourceDir& d) { | 46 void BuildSettings::SetBuildDir(const SourceDir& d) { |
| 47 build_dir_ = d; | 47 build_dir_ = d; |
| 48 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_)); | |
| 52 } | 49 } |
| 53 | 50 |
| 54 base::FilePath BuildSettings::GetFullPath(const SourceFile& file) const { | 51 base::FilePath BuildSettings::GetFullPath(const SourceFile& file) const { |
| 55 return file.Resolve(root_path_); | 52 return file.Resolve(root_path_); |
| 56 } | 53 } |
| 57 | 54 |
| 58 base::FilePath BuildSettings::GetFullPath(const SourceDir& dir) const { | 55 base::FilePath BuildSettings::GetFullPath(const SourceDir& dir) const { |
| 59 return dir.Resolve(root_path_); | 56 return dir.Resolve(root_path_); |
| 60 } | 57 } |
| 61 | 58 |
| 62 base::FilePath BuildSettings::GetFullPathSecondary( | 59 base::FilePath BuildSettings::GetFullPathSecondary( |
| 63 const SourceFile& file) const { | 60 const SourceFile& file) const { |
| 64 return file.Resolve(secondary_source_path_); | 61 return file.Resolve(secondary_source_path_); |
| 65 } | 62 } |
| 66 | 63 |
| 67 base::FilePath BuildSettings::GetFullPathSecondary( | 64 base::FilePath BuildSettings::GetFullPathSecondary( |
| 68 const SourceDir& dir) const { | 65 const SourceDir& dir) const { |
| 69 return dir.Resolve(secondary_source_path_); | 66 return dir.Resolve(secondary_source_path_); |
| 70 } | 67 } |
| 71 | 68 |
| OLD | NEW |