Commit 76ccdcd0 authored by brettw@chromium.org's avatar brettw@chromium.org

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
parent 3557927c
......@@ -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
......
......@@ -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\"', {" +
gyp_header =
"'conditions': [" +
"['\"<(GENERATOR)\"==\"ninja\"', { 'make_global_settings': [" +
make_global_settings +
make_goma_global_settings +
"}],"
"]}]],"
} else {
gyp_header += make_goma_global_settings
}
gyp_header = "'make_global_settings': [" + make_global_settings + "],"
}
}
......
......@@ -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)'],"
}
......@@ -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'],"
}
......@@ -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 +=
gyp_header =
"'conditions':" +
"['\"<(GENERATOR)\"==\"ninja\"', {" +
"['\"<(GENERATOR)\"==\"ninja\"', { 'make_global_settings': [" +
make_global_settings +
make_goma_global_settings +
"}],"
"]}],"
} else {
gyp_header += make_goma_global_settings
}
gyp_header = "'make_global_settings': [" + make_global_settings + "],"
}
}
......
......@@ -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"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment