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

Unified Diff: tools/gn/filesystem_utils.cc

Issue 279023002: Add GN function get_label_info (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comment Created 6 years, 7 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 6279964914f96f150eeea9baed64b361c143fcf2..9140f80660e94f69abdf7d667bcc4cb1d372f9e2 100644
--- a/tools/gn/filesystem_utils.cc
+++ b/tools/gn/filesystem_utils.cc
@@ -667,6 +667,16 @@ SourceDir SourceDirForCurrentDirectory(const base::FilePath& source_root) {
return SourceDirForPath(source_root, cd);
}
+std::string GetOutputSubdirName(const Label& toolchain_label, bool is_default) {
+ // The default toolchain has no subdir.
+ if (is_default)
+ return std::string();
+
+ // For now just assume the toolchain name is always a valid dir name. We may
+ // want to clean up the in the future.
+ return toolchain_label.name() + "/";
+}
+
SourceDir GetToolchainOutputDir(const Settings* settings) {
const OutputFile& toolchain_subdir = settings->toolchain_output_subdir();
@@ -677,6 +687,13 @@ SourceDir GetToolchainOutputDir(const Settings* settings) {
return SourceDir(SourceDir::SWAP_IN, &result);
}
+SourceDir GetToolchainOutputDir(const BuildSettings* build_settings,
+ const Label& toolchain_label, bool is_default) {
+ std::string result = build_settings->build_dir().value();
+ result.append(GetOutputSubdirName(toolchain_label, is_default));
+ return SourceDir(SourceDir::SWAP_IN, &result);
+}
+
SourceDir GetToolchainGenDir(const Settings* settings) {
const OutputFile& toolchain_subdir = settings->toolchain_output_subdir();
@@ -688,6 +705,14 @@ SourceDir GetToolchainGenDir(const Settings* settings) {
return SourceDir(SourceDir::SWAP_IN, &result);
}
+SourceDir GetToolchainGenDir(const BuildSettings* build_settings,
+ const Label& toolchain_label, bool is_default) {
+ std::string result = GetToolchainOutputDir(
+ build_settings, toolchain_label, is_default).value();
+ result.append("gen/");
+ return SourceDir(SourceDir::SWAP_IN, &result);
+}
+
SourceDir GetOutputDirForSourceDir(const Settings* settings,
const SourceDir& source_dir) {
SourceDir toolchain = GetToolchainOutputDir(settings);
« 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