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

Unified Diff: tools/gn/filesystem_utils.cc

Issue 1316653003: GN get_label_info support toolchains for target_out_dir. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/filesystem_utils.h ('k') | tools/gn/filesystem_utils_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/filesystem_utils.cc
diff --git a/tools/gn/filesystem_utils.cc b/tools/gn/filesystem_utils.cc
index 663e6ac3f0c188d708a366d3326eb273605d4130..79e77310d2588cba16d714aa95320eb91316f735 100644
--- a/tools/gn/filesystem_utils.cc
+++ b/tools/gn/filesystem_utils.cc
@@ -729,13 +729,27 @@ SourceDir GetToolchainGenDir(const BuildSettings* build_settings,
SourceDir GetOutputDirForSourceDir(const Settings* settings,
const SourceDir& source_dir) {
- return GetOutputDirForSourceDirAsOutputFile(settings, source_dir).AsSourceDir(
- settings->build_settings());
+ return GetOutputDirForSourceDir(
+ settings->build_settings(), source_dir,
+ settings->toolchain_label(), settings->is_default());
}
-OutputFile GetOutputDirForSourceDirAsOutputFile(const Settings* settings,
- const SourceDir& source_dir) {
- OutputFile result = settings->toolchain_output_subdir();
+SourceDir GetOutputDirForSourceDir(
+ const BuildSettings* build_settings,
+ const SourceDir& source_dir,
+ const Label& toolchain_label,
+ bool is_default_toolchain) {
+ return GetOutputDirForSourceDirAsOutputFile(
+ build_settings, source_dir, toolchain_label, is_default_toolchain)
+ .AsSourceDir(build_settings);
+}
+
+OutputFile GetOutputDirForSourceDirAsOutputFile(
+ const BuildSettings* build_settings,
+ const SourceDir& source_dir,
+ const Label& toolchain_label,
+ bool is_default_toolchain) {
+ OutputFile result(GetOutputSubdirName(toolchain_label, is_default_toolchain));
result.value().append("obj/");
if (source_dir.is_source_absolute()) {
@@ -745,8 +759,7 @@ OutputFile GetOutputDirForSourceDirAsOutputFile(const Settings* settings,
source_dir.value().size() - 2);
} else {
// System-absolute.
- const std::string& build_dir =
- settings->build_settings()->build_dir().value();
+ const std::string& build_dir = build_settings->build_dir().value();
if (base::StartsWith(source_dir.value(), build_dir,
base::CompareCase::SENSITIVE)) {
@@ -771,6 +784,13 @@ OutputFile GetOutputDirForSourceDirAsOutputFile(const Settings* settings,
return result;
}
+OutputFile GetOutputDirForSourceDirAsOutputFile(const Settings* settings,
+ const SourceDir& source_dir) {
+ return GetOutputDirForSourceDirAsOutputFile(
+ settings->build_settings(), source_dir,
+ settings->toolchain_label(), settings->is_default());
+}
+
SourceDir GetGenDirForSourceDir(const Settings* settings,
const SourceDir& source_dir) {
return GetGenDirForSourceDirAsOutputFile(settings, source_dir).AsSourceDir(
« no previous file with comments | « tools/gn/filesystem_utils.h ('k') | tools/gn/filesystem_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698