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

Unified Diff: build/config/compiler/BUILD.gn

Issue 1390383002: GN: Refactor Linux Clang toolchain definitions, plumb use_gold for toolchain_args() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/toolchain/gcc_toolchain.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index d039845318a374d71f44d4d56e1770081f9548de..29566e6d3f5e2fb8f87f16e0fc56ff1fe337bd19 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -50,20 +50,20 @@ declare_args() {
use_gold = is_linux && current_cpu == "x64"
# When we are going to use gold we need to find it.
- if (use_gold) {
- gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin",
- root_build_dir)
- } else {
- gold_path = ""
- }
+ # This is initialized below, after use_gold might have been overridden.
+ gold_path = false
# use_debug_fission: whether to use split DWARF debug info
# files. This can reduce link time significantly, but is incompatible
# with some utilities such as icecc and ccache. Requires gold and
# gcc >= 4.8 or clang.
# http://gcc.gnu.org/wiki/DebugFission
- use_debug_fission = is_debug && !is_win && use_gold &&
- linux_use_bundled_binutils && !use_ccache
+ #
+ # This is a placeholder value indicating that the code below should set
+ # the default. This is necessary to delay the evaluation of the default
+ # value expression until after its input values such as use_gold have
+ # been set, e.g. by a toolchain_args() block.
+ use_debug_fission = "default"
if (is_win) {
# Whether the VS xtree header has been patched to disable warning 4702. If
@@ -73,6 +73,21 @@ declare_args() {
}
}
+# Apply the default logic for these values if they were not set explicitly.
+if (gold_path == false) {
+ if (use_gold) {
+ gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin",
+ root_build_dir)
+ } else {
+ gold_path = ""
+ }
+}
+
+if (use_debug_fission == "default") {
+ use_debug_fission = is_debug && !is_win && use_gold &&
+ linux_use_bundled_binutils && !use_ccache
+}
+
# default_include_dirs ---------------------------------------------------------
#
# This is a separate config so that third_party code (which would not use the
« no previous file with comments | « no previous file | build/toolchain/gcc_toolchain.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698