| 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/scope_per_file_provider.h" | 5 #include "tools/gn/scope_per_file_provider.h" |
| 6 | 6 |
| 7 #include "tools/gn/filesystem_utils.h" | 7 #include "tools/gn/filesystem_utils.h" |
| 8 #include "tools/gn/settings.h" | 8 #include "tools/gn/settings.h" |
| 9 #include "tools/gn/source_file.h" | 9 #include "tools/gn/source_file.h" |
| 10 #include "tools/gn/value.h" | 10 #include "tools/gn/value.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 nullptr, DirectoryWithNoLastSlash( | 78 nullptr, DirectoryWithNoLastSlash( |
| 79 scope_->settings()->build_settings()->build_dir()))); | 79 scope_->settings()->build_settings()->build_dir()))); |
| 80 } | 80 } |
| 81 return root_build_dir_.get(); | 81 return root_build_dir_.get(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 const Value* ScopePerFileProvider::GetRootGenDir() { | 84 const Value* ScopePerFileProvider::GetRootGenDir() { |
| 85 if (!root_gen_dir_) { | 85 if (!root_gen_dir_) { |
| 86 root_gen_dir_.reset(new Value( | 86 root_gen_dir_.reset(new Value( |
| 87 nullptr, | 87 nullptr, |
| 88 DirectoryWithNoLastSlash(GetToolchainGenDir(scope_->settings())))); | 88 DirectoryWithNoLastSlash(GetBuildDirAsSourceDir( |
| 89 BuildDirContext(scope_), BuildDirType::GEN)))); |
| 89 } | 90 } |
| 90 return root_gen_dir_.get(); | 91 return root_gen_dir_.get(); |
| 91 } | 92 } |
| 92 | 93 |
| 93 const Value* ScopePerFileProvider::GetRootOutDir() { | 94 const Value* ScopePerFileProvider::GetRootOutDir() { |
| 94 if (!root_out_dir_) { | 95 if (!root_out_dir_) { |
| 95 root_out_dir_.reset(new Value( | 96 root_out_dir_.reset(new Value( |
| 96 nullptr, | 97 nullptr, |
| 97 DirectoryWithNoLastSlash(GetToolchainOutputDir(scope_->settings())))); | 98 DirectoryWithNoLastSlash(GetScopeCurrentBuildDirAsSourceDir( |
| 99 scope_, BuildDirType::TOOLCHAIN_ROOT)))); |
| 98 } | 100 } |
| 99 return root_out_dir_.get(); | 101 return root_out_dir_.get(); |
| 100 } | 102 } |
| 101 | 103 |
| 102 const Value* ScopePerFileProvider::GetTargetGenDir() { | 104 const Value* ScopePerFileProvider::GetTargetGenDir() { |
| 103 if (!target_gen_dir_) { | 105 if (!target_gen_dir_) { |
| 104 target_gen_dir_.reset( | 106 target_gen_dir_.reset(new Value( |
| 105 new Value(nullptr, DirectoryWithNoLastSlash(GetCurrentGenDir(scope_)))); | 107 nullptr, |
| 108 DirectoryWithNoLastSlash( |
| 109 GetScopeCurrentBuildDirAsSourceDir(scope_, BuildDirType::GEN)))); |
| 106 } | 110 } |
| 107 return target_gen_dir_.get(); | 111 return target_gen_dir_.get(); |
| 108 } | 112 } |
| 109 | 113 |
| 110 const Value* ScopePerFileProvider::GetTargetOutDir() { | 114 const Value* ScopePerFileProvider::GetTargetOutDir() { |
| 111 if (!target_out_dir_) { | 115 if (!target_out_dir_) { |
| 112 target_out_dir_.reset(new Value( | 116 target_out_dir_.reset(new Value( |
| 113 nullptr, DirectoryWithNoLastSlash(GetCurrentOutputDir(scope_)))); | 117 nullptr, |
| 118 DirectoryWithNoLastSlash( |
| 119 GetScopeCurrentBuildDirAsSourceDir(scope_, BuildDirType::OBJ)))); |
| 114 } | 120 } |
| 115 return target_out_dir_.get(); | 121 return target_out_dir_.get(); |
| 116 } | 122 } |
| OLD | NEW |