summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-19 20:31:52 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-19 20:31:52 +0000
commitc48ad0b05fa7c639f76c16909f8b0b32e24c559f (patch)
treebbedd3b406e396f9e60c8c2a566f4361bec9f6bd /build
parent667a0084e28414688620c50b8c342ba3bdeb8456 (diff)
downloadchromium_src-c48ad0b05fa7c639f76c16909f8b0b32e24c559f.zip
chromium_src-c48ad0b05fa7c639f76c16909f8b0b32e24c559f.tar.gz
chromium_src-c48ad0b05fa7c639f76c16909f8b0b32e24c559f.tar.bz2
Pull GN @ 252040, update calls
Updates all rebase_path calls to use the new parameter ordering. Use the new getenv function and delete the Python script we had to get the home directory. Takes advantage of the new ability to have the default value of declare_args blocks be dependent on other values. This simplifies some code. R=scottmg@chromium.org Review URL: https://codereview.chromium.org/164773005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252065 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/config/BUILD.gn2
-rw-r--r--build/config/android/config.gni24
-rw-r--r--build/config/arm.gni87
-rw-r--r--build/config/clang/BUILD.gn6
-rw-r--r--build/config/compiler/BUILD.gn2
-rw-r--r--build/config/ios/ios_sdk.gni23
-rw-r--r--build/config/linux/BUILD.gn2
-rw-r--r--build/config/sysroot.gni9
-rw-r--r--build/config/ui.gni34
-rw-r--r--build/toolchain/clang.gni2
-rw-r--r--build/toolchain/get_default_posix_goma_dir.py11
-rw-r--r--build/toolchain/goma.gni15
-rw-r--r--build/toolchain/linux/BUILD.gn8
-rw-r--r--build/toolchain/mac/BUILD.gn8
-rw-r--r--build/toolchain/win/BUILD.gn2
-rw-r--r--build/util/BUILD.gn4
16 files changed, 100 insertions, 139 deletions
diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn
index 462008c..1831500 100644
--- a/build/config/BUILD.gn
+++ b/build/config/BUILD.gn
@@ -6,7 +6,7 @@ import("//build/config/ui.gni")
declare_args() {
# When set, turns off the (normally-on) iterator debugging and related stuff
- # that is normall turned on for Debug builds. These are generally useful for
+ # that is normally turned on for Debug builds. These are generally useful for
# catching bugs but in some cases may cause conflicts or excessive slowness.
disable_iterator_debugging = false
}
diff --git a/build/config/android/config.gni b/build/config/android/config.gni
index c740812..d012d2b 100644
--- a/build/config/android/config.gni
+++ b/build/config/android/config.gni
@@ -4,20 +4,17 @@
# This file contains common system config stuff for the Android build.
-# TODO(brettw) bug 341772 put this into the is_android block when the toolchain
-# stuff is fixed in the GYP generator. The problem is that when we redo the
-# build in host mode, the OS is not android and the declarations are never
-# seen, which throws an error because these arguments are specified.
-declare_args() {
- android_src = ""
+if (is_android) {
+ declare_args() {
+ # Absolute directory containing the Android source code.
+ android_src = ""
- # This is set when building the Android WebView inside the Android build
- # system, using the 'android' gyp backend. The WebView code is still built
- # when this is unset, but builds using the normal chromium build system.
- is_android_webview_build = false
-}
+ # This is set when building the Android WebView inside the Android build
+ # system, using the 'android' gyp backend. The WebView code is still built
+ # when this is unset, but builds using the normal chromium build system.
+ is_android_webview_build = false
+ }
-if (is_android) {
if (is_android_webview_build) {
assert(android_src != "",
"You must specify android_src for an Android WebView build.")
@@ -26,8 +23,7 @@ if (is_android) {
# android_ndk_root -----------------------------------------------------------
# Full system path to the Android NDK.
- android_ndk_root =
- rebase_path("//third_party/android_tools/ndk", ".", "")
+ android_ndk_root = rebase_path("//third_party/android_tools/ndk")
# stlport stuff --------------------------------------------------------------
diff --git a/build/config/arm.gni b/build/config/arm.gni
index b71ce3d..cf6619c 100644
--- a/build/config/arm.gni
+++ b/build/config/arm.gni
@@ -2,53 +2,56 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-declare_args() {
- # Version of the ARM processor when compiling on ARM. Ignored on non-ARM
- # platforms.
- arm_version = 7
+if (cpu_arch == "arm") {
+ declare_args() {
+ # Version of the ARM processor when compiling on ARM. Ignored on non-ARM
+ # platforms.
+ arm_version = 7
- # The ARM floating point mode. This is either the string "hard", "soft", or
- # "softfp". An empty string means to use the default one for the arm_version.
- arm_float_abi = ""
-}
-
-assert(arm_float_abi == "" ||
- arm_float_abi == "hard" ||
- arm_float_abi == "soft" ||
- arm_float_abi == "softfp")
+ # The ARM floating point mode. This is either the string "hard", "soft", or
+ # "softfp". An empty string means to use the default one for the
+ # arm_version.
+ arm_float_abi = ""
+ }
-if (is_android) {
- arm_use_neon = false
- # Our version of arm_neon_optional from common.gypi. This is not used in the
- # current build so is commented out for now.
- #arm_optionally_use_neon = false
-} else {
- arm_use_neon = true
- #arm_optionally_use_neon = true
-}
+ assert(arm_float_abi == "" ||
+ arm_float_abi == "hard" ||
+ arm_float_abi == "soft" ||
+ arm_float_abi == "softfp")
-if (arm_version == 6) {
- arm_arch = "armv6"
- arm_tune = ""
- if (arm_float_abi == "") {
- arm_float_abi = "softfp"
+ if (is_android) {
+ arm_use_neon = false
+ # Our version of arm_neon_optional from common.gypi. This is not used in the
+ # current build so is commented out for now.
+ #arm_optionally_use_neon = false
+ } else {
+ arm_use_neon = true
+ #arm_optionally_use_neon = true
}
- arm_fpu = "vfp"
- # Thumb is a reduced instruction set available on some ARM processors that
- # has increased code density.
- arm_use_thumb = false
-} else if (arm_version == 7) {
- arm_arch = "armv7-a"
- arm_tune = ""
- if (arm_float_abi == "") {
- arm_float_abi = "softfp"
- }
- arm_use_thumb = true
+ if (arm_version == 6) {
+ arm_arch = "armv6"
+ arm_tune = ""
+ if (arm_float_abi == "") {
+ arm_float_abi = "softfp"
+ }
+ arm_fpu = "vfp"
+ # Thumb is a reduced instruction set available on some ARM processors that
+ # has increased code density.
+ arm_use_thumb = false
- if (arm_use_neon) {
- arm_fpu = "neon"
- } else {
- arm_fpu = "vfpv3-d16"
+ } else if (arm_version == 7) {
+ arm_arch = "armv7-a"
+ arm_tune = ""
+ if (arm_float_abi == "") {
+ arm_float_abi = "softfp"
+ }
+ arm_use_thumb = true
+
+ if (arm_use_neon) {
+ arm_fpu = "neon"
+ } else {
+ arm_fpu = "vfpv3-d16"
+ }
}
}
diff --git a/build/config/clang/BUILD.gn b/build/config/clang/BUILD.gn
index c3ee5da..a0392d2 100644
--- a/build/config/clang/BUILD.gn
+++ b/build/config/clang/BUILD.gn
@@ -4,7 +4,7 @@
declare_args() {
# Indicates if the build should use the Chrome-specific plugins for enforcing
- # coding guidelines, etc.
+ # coding guidelines, etc. Only used when compiling with Clang.
clang_use_chrome_plugins = true
}
@@ -18,11 +18,11 @@ config("find_bad_constructs") {
if (is_mac || is_ios) {
cflags += [ rebase_path(
"//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib",
- ".", root_build_dir) ]
+ root_build_dir) ]
} else if (is_linux) {
cflags += [ rebase_path(
"//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so",
- ".", root_build_dir) ]
+ root_build_dir) ]
}
cflags += [
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index e1b73ee..7db12df 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -148,7 +148,7 @@ config("compiler") {
if (cpu_arch == "x64") {
# Use gold for linking on 64-bit Linux only (on 32-bit it runs out of
# address space, and it doesn't support cross-compiling).
- gold_path = rebase_path("//third_party/gold", ".", root_build_dir)
+ gold_path = rebase_path("//third_party/gold", root_build_dir)
ldflags += [
"-B$gold_path",
diff --git a/build/config/ios/ios_sdk.gni b/build/config/ios/ios_sdk.gni
index dce993d..e6c3e12 100644
--- a/build/config/ios/ios_sdk.gni
+++ b/build/config/ios/ios_sdk.gni
@@ -8,25 +8,20 @@ declare_args() {
ios_sdk_path = ""
# Set to true when targeting a simulator build on iOS. False means that the
- # target is for running on the device. The default value (the empty string)
- # means to pick the default based on the generator.
- use_ios_simulator = ""
+ # target is for running on the device. The default value is to use the
+ # Simulator except when targeting GYP's Xcode builds (for compat with the
+ # existing GYP build).
+ use_ios_simulator = !is_gyp_xcode_generator
# Version of iOS that we're targeting.
ios_deployment_target = "6.0"
}
-if (use_ios_simulator == "") {
- # Pick the default based on the generator. Currently, the Ninja build only
- # supports the simulator, while we default to device builds on Xcode.
- use_ios_simulator = !is_gyp_xcode_generator
-} else {
- # Simulator flag explicitly passed in.
- if (!is_gyp_xcode_generator) {
- # The Ninja build currently only targets the simulator.
- assert(use_ios_simulator,
- "You can't do an iOS device build using Ninja yet.")
- }
+# Simulator flag explicitly passed in.
+if (!is_gyp_xcode_generator) {
+ # The Ninja build currently only targets the simulator.
+ assert(use_ios_simulator,
+ "You can't do an iOS device build using Ninja yet.")
}
if (ios_sdk_path == "") {
diff --git a/build/config/linux/BUILD.gn b/build/config/linux/BUILD.gn
index 15b0c91..470922f 100644
--- a/build/config/linux/BUILD.gn
+++ b/build/config/linux/BUILD.gn
@@ -12,7 +12,7 @@ config("sdk") {
# Need to get some linker flags out of the sysroot.
ldflags += [ exec_script("sysroot_ld_path.py",
- [ rebase_path("//build/linux/sysroot_ld_path.sh", ".", root_build_dir),
+ [ rebase_path("//build/linux/sysroot_ld_path.sh", root_build_dir),
sysroot ],
"value") ]
}
diff --git a/build/config/sysroot.gni b/build/config/sysroot.gni
index 6340c3a7..cecc1ea 100644
--- a/build/config/sysroot.gni
+++ b/build/config/sysroot.gni
@@ -24,18 +24,17 @@ if (is_android) {
# For official builds, use the sysroot checked into the internal source repo
# so that the builds work on older versions of Linux.
if (cpu_arch == "x64") {
- sysroot = rebase_path(
- "//chrome/installer/linux/debian_wheezy_amd64-sysroot", ".", "")
+ sysroot =
+ rebase_path("//chrome/installer/linux/debian_wheezy_amd64-sysroot")
} else if (cpu_arch == "x86") {
- sysroot = rebase_path(
- "//chrome/installer/linux/debian_wheezy_i386-sysroot", ".", "")
+ sysroot = rebase_path("//chrome/installer/linux/debian_wheezy_i386-sysroot")
} else {
# Any other builds don't use a sysroot.
sysroot = ""
}
} else if (is_linux && !is_chromeos) {
if (cpu_arch == "mipsel") {
- sysroot = rebase_path("//mipsel-sysroot/sysroot", ".", "")
+ sysroot = rebase_path("//mipsel-sysroot/sysroot")
} else {
sysroot = ""
}
diff --git a/build/config/ui.gni b/build/config/ui.gni
index b9969c0..08964df 100644
--- a/build/config/ui.gni
+++ b/build/config/ui.gni
@@ -10,42 +10,20 @@
# e.g. base, so they need to be global.
declare_args() {
- # True means the UI is built useing the "views" framework.
- toolkit_views = false
-
# Indicates if Ash is enabled. Ash is the Aura SHell which provides a
# desktop-like environment for Aura. Requires use_aura = true
- use_ash = false
-
- # Indicates if Aura is enabled. Aura is a low-level windowing library, sort
- # of a replacement for GDI or GTK.
- use_aura = false
+ use_ash = is_win || is_chromeos
# Indicates if Ozone is enabled. Ozone is a low-level library layer for Linux
# that does not require X11.
use_ozone = false
-}
-
-if (is_win || is_chromeos) {
- # Windows currelty implies Aura.
- # TODO(brettw) bug 342937 move to declare_args block.
- use_ash = true
- use_aura = true
-}
-
-if (is_linux || use_ozone) {
- use_aura = true
-}
-if (!use_aura) {
- use_ash = false # Ash needs Aura.
-}
+ # Indicates if Aura is enabled. Aura is a low-level windowing library, sort
+ # of a replacement for GDI or GTK.
+ use_aura = is_linux || use_ozone || is_win || is_chromeos || use_ash
-# TODO(brettw) bug 342937 move this to the declare_args block above when this
-# is supported. It would look like:
-# toolkit_views = is_win || is_chromeos || use_aura
-if (is_win || is_chromeos || use_aura) {
- toolkit_views = true
+ # True means the UI is built useing the "views" framework.
+ toolkit_views = is_win || is_chromeos || use_aura
}
# Additional dependent variables -----------------------------------------------
diff --git a/build/toolchain/clang.gni b/build/toolchain/clang.gni
index 433ab32..861a681 100644
--- a/build/toolchain/clang.gni
+++ b/build/toolchain/clang.gni
@@ -3,6 +3,8 @@
# found in the LICENSE file.
declare_args() {
+ # Enable the optional type profiler in Clang, which will tag heap allocations
+ # with the allocation type.
use_clang_type_profiler = false
}
diff --git a/build/toolchain/get_default_posix_goma_dir.py b/build/toolchain/get_default_posix_goma_dir.py
deleted file mode 100644
index 2aa0267..0000000
--- a/build/toolchain/get_default_posix_goma_dir.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This script returns the default goma directory for Posix systems, which is
-# relative to the user's home directory. On Windows, goma.gypi hardcodes a
-# value.
-
-import os
-
-print '"' + os.environ['HOME'] + '/goma"'
diff --git a/build/toolchain/goma.gni b/build/toolchain/goma.gni
index dca6a4d..1f34723 100644
--- a/build/toolchain/goma.gni
+++ b/build/toolchain/goma.gni
@@ -8,19 +8,16 @@
# people during the transition.
declare_args() {
+ # Set to true to enable distributed compilation using Goma.
use_goma = false
- goma_dir = ""
-}
-
-if (use_goma && goma_dir == "") {
- # Set the default goma directory. This must be a character-for-character
- # match for the GYP default or else the compilers for the different targets
- # won't match and GYP will assert.
+ # Set the default value based on the platform.
if (is_win) {
- goma_dir = "c:\goma\goma-win"
+ # Absolute directory containing the Goma source code.
+ goma_dir = "C:\goma\goma-win"
} else {
- goma_dir = exec_script("get_default_posix_goma_dir.py", [], "value")
+ # Absolute directory containing the Goma source code.
+ goma_dir = getenv("HOME") + "/goma"
}
}
diff --git a/build/toolchain/linux/BUILD.gn b/build/toolchain/linux/BUILD.gn
index 38f4b184..62e7278 100644
--- a/build/toolchain/linux/BUILD.gn
+++ b/build/toolchain/linux/BUILD.gn
@@ -61,10 +61,10 @@ gcc_toolchain("x86") {
if (is_clang) {
if (use_clang_type_profiler) {
prefix = rebase_path("//third_party/llvm-allocated-type/Linux_ia32/bin",
- ".", root_build_dir)
+ root_build_dir)
} else {
prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin",
- ".", root_build_dir)
+ root_build_dir)
}
cc = "$prefix/clang"
cxx = "$prefix/clang++"
@@ -84,10 +84,10 @@ gcc_toolchain("x64") {
if (is_clang) {
if (use_clang_type_profiler) {
prefix = rebase_path("//third_party/llvm-allocated-type/Linux_x64/bin",
- ".", root_build_dir)
+ root_build_dir)
} else {
prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin",
- ".", root_build_dir)
+ root_build_dir)
}
cc = "$prefix/clang"
cxx = "$prefix/clang++"
diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn
index afd09e0..35f80b0 100644
--- a/build/toolchain/mac/BUILD.gn
+++ b/build/toolchain/mac/BUILD.gn
@@ -15,8 +15,10 @@ import("//build/toolchain/clang.gni")
import("//build/toolchain/goma.gni")
if (is_clang) {
- cc = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang", ".", root_build_dir)
- cxx = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang++", ".", root_build_dir)
+ cc = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang",
+ root_build_dir)
+ cxx = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang++",
+ root_build_dir)
# Set the GYP header for all toolchains when running under Clang.
if (is_gyp) {
@@ -50,7 +52,7 @@ ld = cxx
# This will copy the gyp-mac-tool to the build directory. We pass in the source
# file of the win tool.
gyp_mac_tool_source =
- rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", ".", root_build_dir)
+ rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", root_build_dir)
exec_script("setup_toolchain.py", [ gyp_mac_tool_source ], "value")
# Shared toolchain definition. Invocations should set toolchain_os to set the
diff --git a/build/toolchain/win/BUILD.gn b/build/toolchain/win/BUILD.gn
index 1c1977b..c35ec45 100644
--- a/build/toolchain/win/BUILD.gn
+++ b/build/toolchain/win/BUILD.gn
@@ -14,7 +14,7 @@ import("//build/config/win/visual_studio_version.gni")
# Its arguments are the VS path and the compiler wrapper tool. It will write
# "environment.x86" and "environment.x64" to the build directory and return a
# list to us.
-gyp_win_tool_path = rebase_path("//tools/gyp/pylib/gyp/win_tool.py", ".",
+gyp_win_tool_path = rebase_path("//tools/gyp/pylib/gyp/win_tool.py",
root_build_dir)
exec_script("setup_toolchain.py", [ visual_studio_path, gyp_win_tool_path ],
"string")
diff --git a/build/util/BUILD.gn b/build/util/BUILD.gn
index d43cc49..9275585 100644
--- a/build/util/BUILD.gn
+++ b/build/util/BUILD.gn
@@ -24,8 +24,8 @@ custom("last_change") {
output_header = "$target_gen_dir/last_change.h"
outputs = [ output_header ]
- build_relative_src = rebase_path("//", ".", root_build_dir)
- build_relative_outputs = rebase_path(output_header, ".", root_build_dir)
+ build_relative_src = rebase_path("//", root_build_dir)
+ build_relative_outputs = rebase_path(output_header, root_build_dir)
args = [
"--source-dir=$build_relative_src",