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

Unified Diff: build/config/BUILDCONFIG.gn

Issue 1373593003: Allow a custom toolchain to be injected into BUILDCONFIG.gn (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Fix comment typo. Created 5 years, 3 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 | « no previous file | build/config/gcc/gcc_version.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/BUILDCONFIG.gn
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index 234332b8547e95b0185e9bc4bcaaf1c1bfedcf63..e3a324f56568ba91100fb3c1087be8b72273b7c4 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -132,9 +132,26 @@ declare_args() {
cros_use_custom_toolchain = false
}
+ # Allows the path to a custom target toolchain to be injected as a single
+ # argument, and set as the default toolchain.
+ # Note: On ChromeOS, do not set this argument. Instead, set
+ # cros_use_custom_toolchain, and set each of the args required by
+ # //build/toolchain/cros:target.
+ custom_toolchain = ""
brettw 2015/09/28 19:58:28 We need to keep this file cleaner than this. Pleas
slan 2015/09/28 20:50:40 There are two paths around this redundancy: 1) Al
slan 2015/09/28 21:21:42 Removed.
+
# DON'T ADD MORE FLAGS HERE. Read the comment above.
}
+if (current_os == "chromeos") {
+ assert(
+ custom_toolchain == "",
+ "|custom_toolchain| should not be set in args on ChromeOS. Set cros_use_custom_toolchain instead.")
+
+ if (cros_use_custom_toolchain) {
+ custom_toolchain = "//build/toolchain/cros:target"
+ }
+}
+
# =============================================================================
# OS DEFINITIONS
# =============================================================================
@@ -530,9 +547,6 @@ if (is_win) {
host_toolchain = "//build/toolchain/linux:$host_cpu"
set_default_toolchain("//build/toolchain/linux:$current_cpu")
}
- if (is_chromeos && cros_use_custom_toolchain) {
- set_default_toolchain("//build/toolchain/cros:target")
- }
} else if (is_mac) {
host_toolchain = "//build/toolchain/mac:clang_x64"
set_default_toolchain(host_toolchain)
@@ -547,6 +561,11 @@ if (is_win) {
host_toolchain = "//build/toolchain/linux:clang_x64"
}
+# Set the custom default toolchain.
+if (custom_toolchain != "") {
+ set_default_toolchain(custom_toolchain)
brettw 2015/09/28 19:58:28 let's restructure the code above to assign to a va
slan 2015/09/28 20:50:40 Done.
+}
+
# ==============================================================================
# COMPONENT SETUP
# ==============================================================================
« no previous file with comments | « no previous file | build/config/gcc/gcc_version.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698