summaryrefslogtreecommitdiffstats
path: root/build/toolchain
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-10 06:09:59 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-10 06:09:59 +0000
commit76ccdcd0575a7b2517d215b50dbf9de8d552418f (patch)
tree38b206d24a6efcc964d84aa3acd6641035857bbb /build/toolchain
parent3557927cd25e1e9f9586f74d925f036e6ada28d7 (diff)
downloadchromium_src-76ccdcd0575a7b2517d215b50dbf9de8d552418f.zip
chromium_src-76ccdcd0575a7b2517d215b50dbf9de8d552418f.tar.gz
chromium_src-76ccdcd0575a7b2517d215b50dbf9de8d552418f.tar.bz2
Improves GN's make_global_settings
This makes make_global_settings closer to the GYP version. Previously it had relied on GYP concatenating two lists when running with goma, but it doesn't actually behave this way, resulting in unexpected output. TBR=scottmg Review URL: https://codereview.chromium.org/132833002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244104 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/toolchain')
-rw-r--r--build/toolchain/android/BUILD.gn25
-rw-r--r--build/toolchain/clang.gni5
-rw-r--r--build/toolchain/goma.gni4
-rw-r--r--build/toolchain/linux/BUILD.gn21
-rw-r--r--build/toolchain/mac/BUILD.gn2
5 files changed, 25 insertions, 32 deletions
diff --git a/build/toolchain/android/BUILD.gn b/build/toolchain/android/BUILD.gn
index 021fdaf..8f84f69 100644
--- a/build/toolchain/android/BUILD.gn
+++ b/build/toolchain/android/BUILD.gn
@@ -23,7 +23,7 @@ if (is_gyp) {
# any given build.
if (is_clang) {
# Set the GYP header for all toolchains when running under Clang.
- gyp_header = make_clang_global_settings
+ make_global_settings = make_clang_global_settings
} else {
# Find the compiler for GYP for non-Clang Android.
if (cpu_arch == "x86") {
@@ -47,13 +47,11 @@ if (is_gyp) {
# directory.
android_compilers = exec_script("find_android_compiler.py",
[android_toolchain], "value")
- gyp_header =
- "'make_global_settings': [" +
+ make_global_settings =
"['CC', '" + android_compilers[0] + "']," +
"['CXX', '" + android_compilers[1] + "']," +
"['CC.host', '" + android_compilers[2] + "']," +
- "['CXX.host', '" + android_compilers[3] + "']," +
- "],"
+ "['CXX.host', '" + android_compilers[3] + "'],"
}
if (use_goma) {
@@ -65,15 +63,14 @@ if (is_gyp) {
# GYP will interpret the file once for each generator, so we have to write
# this condition into the GYP file since the user could have more than one
# generator set.
- if (gyp_header == "") {
- gyp_header +=
- "'conditions':" +
- "['\"<(GENERATOR)\"==\"ninja\"', {" +
- make_goma_global_settings +
- "}],"
- } else {
- gyp_header += make_goma_global_settings
- }
+ gyp_header =
+ "'conditions': [" +
+ "['\"<(GENERATOR)\"==\"ninja\"', { 'make_global_settings': [" +
+ make_global_settings +
+ make_goma_global_settings +
+ "]}]],"
+ } else {
+ gyp_header = "'make_global_settings': [" + make_global_settings + "],"
}
}
diff --git a/build/toolchain/clang.gni b/build/toolchain/clang.gni
index d45ea06..433ab32 100644
--- a/build/toolchain/clang.gni
+++ b/build/toolchain/clang.gni
@@ -25,11 +25,10 @@ if (is_clang) {
make_clang_dir = "third_party/llvm-build/Release+Asserts"
}
+ # This includes the array values but not the 'make_global_settings' name.
make_clang_global_settings =
- "'make_global_settings': [" +
"['CC', '$make_clang_dir/bin/clang']," +
"['CXX', '$make_clang_dir/bin/clang++']," +
"['CC.host', '\$(CC)']," +
- "['CXX.host', '\$(CXX)']," +
- "],"
+ "['CXX.host', '\$(CXX)'],"
}
diff --git a/build/toolchain/goma.gni b/build/toolchain/goma.gni
index 15cb542..66348a9 100644
--- a/build/toolchain/goma.gni
+++ b/build/toolchain/goma.gni
@@ -42,10 +42,8 @@ if (use_goma && goma_dir == "") {
if (use_goma) {
# Define the toolchain for the GYP build when using goma.
make_goma_global_settings =
- "'make_global_settings': [" +
"['CC_wrapper', '$goma_dir/gomacc']," +
"['CXX_wrapper', '$goma_dir/gomacc']," +
"['CC.host_wrapper', '$goma_dir/gomacc']," +
- "['CXX.host_wrapper', '$goma_dir/gomacc']," +
- "],"
+ "['CXX.host_wrapper', '$goma_dir/gomacc'],"
}
diff --git a/build/toolchain/linux/BUILD.gn b/build/toolchain/linux/BUILD.gn
index 393288b..d744573 100644
--- a/build/toolchain/linux/BUILD.gn
+++ b/build/toolchain/linux/BUILD.gn
@@ -13,9 +13,9 @@ if (is_gyp) {
# any given build.
if (is_clang) {
# Set the GYP header for all toolchains when running under Clang.
- gyp_header = make_clang_global_settings
+ make_global_settings = make_clang_global_settings
} else {
- gyp_header = ""
+ make_global_settings = ""
}
if (use_goma) {
@@ -27,15 +27,14 @@ if (is_gyp) {
# GYP will interpret the file once for each generator, so we have to write
# this condition into the GYP file since the user could have more than one
# generator set.
- if (gyp_header == "") {
- gyp_header +=
- "'conditions':" +
- "['\"<(GENERATOR)\"==\"ninja\"', {" +
- make_goma_global_settings +
- "}],"
- } else {
- gyp_header += make_goma_global_settings
- }
+ gyp_header =
+ "'conditions':" +
+ "['\"<(GENERATOR)\"==\"ninja\"', { 'make_global_settings': [" +
+ make_global_settings +
+ make_goma_global_settings +
+ "]}],"
+ } else {
+ gyp_header = "'make_global_settings': [" + make_global_settings + "],"
}
}
diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn
index 92cd44b0..7e552d6 100644
--- a/build/toolchain/mac/BUILD.gn
+++ b/build/toolchain/mac/BUILD.gn
@@ -18,7 +18,7 @@ if (is_clang) {
# Set the GYP header for all toolchains when running under Clang.
if (is_gyp) {
- gyp_header = make_clang_global_settings
+ gyp_header = "'make_global_settings': [" + make_clang_global_settings + "],"
}
} else {
cc = "gcc"