diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-10 06:09:59 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-10 06:09:59 +0000 |
commit | 76ccdcd0575a7b2517d215b50dbf9de8d552418f (patch) | |
tree | 38b206d24a6efcc964d84aa3acd6641035857bbb | |
parent | 3557927cd25e1e9f9586f74d925f036e6ada28d7 (diff) | |
download | chromium_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
-rw-r--r-- | build/config/compiler/BUILD.gn | 5 | ||||
-rw-r--r-- | build/toolchain/android/BUILD.gn | 25 | ||||
-rw-r--r-- | build/toolchain/clang.gni | 5 | ||||
-rw-r--r-- | build/toolchain/goma.gni | 4 | ||||
-rw-r--r-- | build/toolchain/linux/BUILD.gn | 21 | ||||
-rw-r--r-- | build/toolchain/mac/BUILD.gn | 2 |
6 files changed, 29 insertions, 33 deletions
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 623e816..87f7f53 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -173,8 +173,11 @@ config("compiler") { "-ffunction-sections", "-funwind-tables", "-fno-short-enums", - "-finline-limit=64", ] + if (!is_clang) { + # Clang doesn't support this one. + cflags += [ "-finline-limit=64" ] + } if (is_android_webview_build) { # Android predefines this as 1; undefine it here so Chromium can redefine # it later to be 2 for chromium code and unset for third party code. This 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" |