diff options
55 files changed, 237 insertions, 234 deletions
@@ -170,7 +170,7 @@ group("root") { deps += [ "//rlz:rlz_lib" ] } - if (cpu_arch == "x86" || cpu_arch == "x64") { + if (current_cpu == "x86" || current_cpu == "x64") { # YASM is x86/x64 only. deps += [ "//third_party/yasm($host_toolchain)" ] } diff --git a/base/allocator/BUILD.gn b/base/allocator/BUILD.gn index e931b1c..a07a356 100644 --- a/base/allocator/BUILD.gn +++ b/base/allocator/BUILD.gn @@ -36,7 +36,7 @@ if (is_win) { args = [ visual_studio_path + "/vc/lib", rebase_path("$target_gen_dir/allocator"), - cpu_arch, + current_cpu, ] } } diff --git a/breakpad/BUILD.gn b/breakpad/BUILD.gn index c928081..66835e2 100644 --- a/breakpad/BUILD.gn +++ b/breakpad/BUILD.gn @@ -511,7 +511,7 @@ if (is_linux || is_android) { configs += [ "//build/config/compiler:no_chromium_code" ] public_configs = [ ":client_config" ] - if (cpu_arch == "arm" && is_chromeos) { + if (current_cpu == "arm" && is_chromeos) { # Avoid running out of registers in # linux_syscall_support.h:sys_clone()'s inline assembly. cflags = [ "-marm" ] @@ -630,7 +630,7 @@ if (is_linux) { include_dirs = [ "src" ] - if (cpu_arch == "mipsel" && is_android) { + if (current_cpu == "mipsel" && is_android) { include_dirs += [ "src/common/android/include" ] } } diff --git a/build/compiled_action.gni b/build/compiled_action.gni index e5059aa..b6d0c4d 100644 --- a/build/compiled_action.gni +++ b/build/compiled_action.gni @@ -66,7 +66,7 @@ # saves unnecessarily compiling your tool for the target platform. But if you # need a target build of your tool as well, just leave off the if statement. -if (build_os == "win") { +if (host_os == "win") { _host_executable_suffix = ".exe" } else { _host_executable_suffix = "" diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn index 5f93dd9..49b5cfe 100644 --- a/build/config/BUILD.gn +++ b/build/config/BUILD.gn @@ -231,7 +231,7 @@ config("debug") { # have to tell it to turn it off. defines += [ "_HAS_ITERATOR_DEBUGGING=0" ] } - } else if (is_linux && !is_android && cpu_arch == "x64" && + } else if (is_linux && !is_android && current_cpu == "x64" && !disable_iterator_debugging) { # Enable libstdc++ debugging facilities to help catch problems early, see # http://crbug.com/65151 . diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn index 242cea9..7822261 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -72,11 +72,12 @@ declare_args() { is_debug = true # Whether we're a traditional desktop unix. - is_desktop_linux = os == "linux" && os != "chromeos" + is_desktop_linux = current_os == "linux" && current_os != "chromeos" # Set to true when compiling with the Clang compiler. Typically this is used # to configure warnings. - is_clang = os == "mac" || os == "ios" || os == "linux" || os == "chromeos" + is_clang = current_os == "mac" || current_os == "ios" || + current_os == "linux" || current_os == "chromeos" # Selects the desired build flavor. Official builds get additional # processing to prepare for release. Normally you will want to develop and @@ -100,21 +101,22 @@ declare_args() { # Compile for Thread Sanitizer to find threading bugs. is_tsan = false - if (os == "chromeos") { + if (current_os == "chromeos") { # Allows the target toolchain to be injected as arguments. This is needed # to support the CrOS build system which supports per-build-configuration # toolchains. cros_use_custom_toolchain = false } - # TODO(cjhopman): Make target_arch work for all platforms. + # TODO(dpranke): Replace target_arch with target_cpu. - # Architecture of the target device. For Android builds, this will be equal to - # the cpu_arch of the default toolchain. When checking the CPU architecture - # for source files and build dependencies you should almost alway use cpu_arch - # instead. cpu_arch is the architecture of the current toolchain and allows - # cross-compiles (compiling the same target for multiple toolchains in the - # same build) to work. + # Architecture of the target device. For Android builds, this will be + # equal to the current_cpu of the default toolchain. When checking + # the CPU architecture for source files and build dependencies you + # should almost alway use current_cpu instead. current_cpu is the + # architecture of the current toolchain and allows cross-compiles + # (compiling the same target for multiple toolchains in the same build) + # to work. target_arch = "arm" # TODO(brettw) remove this flag (and therefore enable linking all targets) on @@ -142,10 +144,10 @@ assert(current_os == os) # generally too different despite being based on the Linux kernel). # # Do not add more is_* variants here for random lesser-used Unix systems like -# aix or one of the BSDs. If you need to check these, just check the os value -# directly. +# aix or one of the BSDs. If you need to check these, just check the +# current_os value directly. -if (os == "win") { +if (current_os == "win") { is_android = false is_chromeos = false is_ios = false @@ -154,7 +156,7 @@ if (os == "win") { is_nacl = false is_posix = false is_win = true -} else if (os == "mac") { +} else if (current_os == "mac") { is_android = false is_chromeos = false is_ios = false @@ -163,7 +165,7 @@ if (os == "win") { is_nacl = false is_posix = true is_win = false -} else if (os == "android") { +} else if (current_os == "android") { is_android = true is_chromeos = false is_ios = false @@ -172,7 +174,7 @@ if (os == "win") { is_nacl = false is_posix = true is_win = false -} else if (os == "chromeos") { +} else if (current_os == "chromeos") { is_android = false is_chromeos = true is_ios = false @@ -181,9 +183,10 @@ if (os == "win") { is_nacl = false is_posix = true is_win = false -} else if (os == "nacl") { - # os == "nacl" will be passed by the nacl toolchain definition. It is not - # set by default or on the command line. We treat is as a Posix variant. +} else if (current_os == "nacl") { + # current_os == "nacl" will be passed by the nacl toolchain definition. + # It is not set by default or on the command line. We treat is as a + # Posix variant. is_android = false is_chromeos = false is_ios = false @@ -192,7 +195,7 @@ if (os == "win") { is_nacl = true is_posix = true is_win = false -} else if (os == "ios") { +} else if (current_os == "ios") { is_android = false is_chromeos = false is_ios = true @@ -201,7 +204,7 @@ if (os == "win") { is_nacl = false is_posix = true is_win = false -} else if (os == "linux") { +} else if (current_os == "linux") { is_android = false is_chromeos = false is_ios = false @@ -218,10 +221,10 @@ if (os == "win") { if (is_android) { # TODO(cjhopman): enable this assert once bots are updated to not set - # cpu_arch. - #assert(cpu_arch == build_cpu_arch, "Android device target architecture should - # be set with 'target_arch', not 'cpu_arch'") - cpu_arch = target_arch + # current_cpu. + #assert(current_cpu == host_cpu, "Android device target architecture should + # be set with 'target_arch', not 'current_cpu'") + current_cpu = target_arch } # ============================================================================= @@ -530,28 +533,28 @@ set_defaults("test") { if (is_win) { # On windows we use the same toolchain for host and target by default. - # TODO(dpranke): rename the toolchains to x64 and x86 to match cpu_arch. - if (cpu_arch == "x64") { + # TODO(dpranke): rename the toolchains to x64 and x86 to match current_cpu. + if (current_cpu == "x64") { host_toolchain = "//build/toolchain/win:64" - } else if (cpu_arch == "x86") { + } else if (current_cpu == "x86") { host_toolchain = "//build/toolchain/win:32" } set_default_toolchain("$host_toolchain") } else if (is_android) { # Use clang for the x86/64 Linux host builds. - if (build_cpu_arch == "x86" || build_cpu_arch == "x64") { - host_toolchain = "//build/toolchain/linux:clang_$build_cpu_arch" + if (host_cpu == "x86" || host_cpu == "x64") { + host_toolchain = "//build/toolchain/linux:clang_$host_cpu" } else { - host_toolchain = "//build/toolchain/linux:$build_cpu_arch" + host_toolchain = "//build/toolchain/linux:$host_cpu" } - set_default_toolchain("//build/toolchain/android:$cpu_arch") + set_default_toolchain("//build/toolchain/android:$current_cpu") } else if (is_linux) { if (is_clang) { - host_toolchain = "//build/toolchain/linux:clang_$build_cpu_arch" - set_default_toolchain("//build/toolchain/linux:clang_$cpu_arch") + host_toolchain = "//build/toolchain/linux:clang_$host_cpu" + set_default_toolchain("//build/toolchain/linux:clang_$current_cpu") } else { - host_toolchain = "//build/toolchain/linux:$build_cpu_arch" - set_default_toolchain("//build/toolchain/linux:$cpu_arch") + host_toolchain = "//build/toolchain/linux:$host_cpu" + set_default_toolchain("//build/toolchain/linux:$current_cpu") } if (is_chromeos && cros_use_custom_toolchain) { set_default_toolchain("//build/toolchain/cros:target") diff --git a/build/config/allocator.gni b/build/config/allocator.gni index 9fcfe49..4c9ae67 100644 --- a/build/config/allocator.gni +++ b/build/config/allocator.gni @@ -3,7 +3,7 @@ # found in the LICENSE file. # TODO(GYP): Make tcmalloc work on win. -if (is_android || cpu_arch == "mipsel" || is_mac || is_asan || is_win) { +if (is_android || current_cpu == "mipsel" || is_mac || is_asan || is_win) { _default_allocator = "none" } else { _default_allocator = "tcmalloc" diff --git a/build/config/android/config.gni b/build/config/android/config.gni index 0105a64..cebf4de 100644 --- a/build/config/android/config.gni +++ b/build/config/android/config.gni @@ -50,9 +50,9 @@ if (is_android) { # Defines the name the Android build gives to the current host CPU # architecture, which is different than the names GN uses. - if (build_cpu_arch == "x64") { + if (host_cpu == "x64") { android_host_arch = "x86_64" - } else if (build_cpu_arch == "x86") { + } else if (host_cpu == "x86") { android_host_arch = "x86" } else { assert(false, "Need Android toolchain support for your build CPU arch.") @@ -60,7 +60,7 @@ if (is_android) { # Defines the name the Android build gives to the current host CPU # architecture, which is different than the names GN uses. - if (build_os == "linux") { + if (host_os == "linux") { android_host_os = "linux" } else { assert(false, "Need Android toolchain support for your build OS.") @@ -119,32 +119,32 @@ if (is_android) { # Location of libgcc. This is only needed for the current GN toolchain, so we # only need to define the current one, rather than one for every platform # like the toolchain roots. - if (cpu_arch == "x86") { + if (current_cpu == "x86") { android_prebuilt_arch = "android-x86" _binary_prefix = "i686-linux-android" android_toolchain_root = "$x86_android_toolchain_root" android_libgcc_file = "$android_toolchain_root/lib/gcc/i686-linux-android/${_android_toolchain_version}/libgcc.a" - } else if (cpu_arch == "arm") { + } else if (current_cpu == "arm") { android_prebuilt_arch = "android-arm" _binary_prefix = "arm-linux-androideabi" android_toolchain_root = "$arm_android_toolchain_root" android_libgcc_file = "$android_toolchain_root/lib/gcc/arm-linux-androideabi/${_android_toolchain_version}/libgcc.a" - } else if (cpu_arch == "mipsel") { + } else if (current_cpu == "mipsel") { android_prebuilt_arch = "android-mips" _binary_prefix = "mipsel-linux-android" android_toolchain_root = "$mips_android_toolchain_root" android_libgcc_file = "$android_toolchain_root/lib/gcc/mipsel-linux-android/${_android_toolchain_version}/libgcc.a" - } else if (cpu_arch == "x64") { + } else if (current_cpu == "x64") { android_prebuilt_arch = "android-x86_64" _binary_prefix = "x86_64-linux-android" android_toolchain_root = "$x86_64_android_toolchain_root" android_libgcc_file = "$android_toolchain_root/lib/gcc/x86_64-linux-android/${_android_toolchain_version}/libgcc.a" - } else if (cpu_arch == "arm64") { + } else if (current_cpu == "arm64") { android_prebuilt_arch = "android-arm64" _binary_prefix = "aarch64-linux-android" android_toolchain_root = "$arm64_android_toolchain_root" android_libgcc_file = "$android_toolchain_root/lib/gcc/aarch64-linux-android/${_android_toolchain_version}/libgcc.a" - } else if (cpu_arch == "mips64el") { + } else if (current_cpu == "mips64el") { android_prebuilt_arch = "android-mips64" _binary_prefix = "mips64el-linux-android" android_toolchain_root = "$mips64_android_toolchain_root" @@ -169,25 +169,25 @@ if (is_android) { # ABI ------------------------------------------------------------------------ - if (cpu_arch == "x86") { + if (current_cpu == "x86") { android_app_abi = "x86" - } else if (cpu_arch == "arm") { + } else if (current_cpu == "arm") { import("//build/config/arm.gni") if (arm_version < 7) { android_app_abi = "armeabi" } else { android_app_abi = "armeabi-v7a" } - } else if (cpu_arch == "mipsel") { + } else if (current_cpu == "mipsel") { android_app_abi = "mips" - } else if (cpu_arch == "x64") { + } else if (current_cpu == "x64") { android_app_abi = "x86_64" - } else if (cpu_arch == "arm64") { + } else if (current_cpu == "arm64") { android_app_abi = "arm64-v8a" - } else if (cpu_arch == "mips64el") { + } else if (current_cpu == "mips64el") { android_app_abi = "mips64" } else { - assert(false, "Unknown Android ABI: " + cpu_arch) + assert(false, "Unknown Android ABI: " + current_cpu) } } else { if (!defined(is_android_webview_build)) { diff --git a/build/config/arm.gni b/build/config/arm.gni index d39c6e9..778ecc1 100644 --- a/build/config/arm.gni +++ b/build/config/arm.gni @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -if (cpu_arch == "arm") { +if (current_cpu == "arm") { declare_args() { # Version of the ARM processor when compiling on ARM. Ignored on non-ARM # platforms. diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 1460fb3..8cb4088 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -3,10 +3,10 @@ # found in the LICENSE file. import("//build/config/android/config.gni") -if (cpu_arch == "arm") { +if (current_cpu == "arm") { import("//build/config/arm.gni") } -if (cpu_arch == "mipsel" || cpu_arch == "mips64el") { +if (current_cpu == "mipsel" || current_cpu == "mips64el") { import("//build/config/mips.gni") } if (is_posix) { @@ -24,7 +24,7 @@ declare_args() { # These are not multi-arch so cannot be used except on x86 and x86-64 (the # only two architectures that are currently checked in). Turn this off when # you are using a custom toolchain and need to control -B in cflags. - linux_use_bundled_binutils = is_linux && cpu_arch == "x64" + linux_use_bundled_binutils = is_linux && current_cpu == "x64" # Compile in such a way as to enable profiling of the generated code. For # example, don't omit the frame pointer and leave in symbols. @@ -39,7 +39,7 @@ declare_args() { # 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). - use_gold = is_linux && cpu_arch == "x64" + use_gold = is_linux && current_cpu == "x64" # use_debug_fission: whether to use split DWARF debug info # files. This can reduce link time significantly, but is incompatible @@ -121,7 +121,7 @@ config("compiler") { } # Linker warnings. - if (!(is_chromeos && cpu_arch == "arm") && !is_mac) { + if (!(is_chromeos && current_cpu == "arm") && !is_mac) { # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580 ldflags += [ "-Wl,--fatal-warnings" ] } @@ -172,12 +172,12 @@ config("compiler") { common_mac_flags = [] # CPU architecture. - if (cpu_arch == "x64") { + if (current_cpu == "x64") { common_mac_flags += [ "-arch", "x86_64", ] - } else if (cpu_arch == "x86") { + } else if (current_cpu == "x86") { common_mac_flags += [ "-arch", "i386", @@ -222,13 +222,13 @@ config("compiler") { # CPU architecture. We may or may not be doing a cross compile now, so for # simplicity we always explicitly set the architecture. - if (cpu_arch == "x64") { + if (current_cpu == "x64") { cflags += [ "-m64", "-march=x86-64", ] ldflags += [ "-m64" ] - } else if (cpu_arch == "x86") { + } else if (current_cpu == "x86") { cflags += [ "-m32" ] ldflags += [ "-m32" ] if (is_clang) { @@ -242,7 +242,7 @@ config("compiler") { "-mstackrealign", ] } - } else if (cpu_arch == "arm") { + } else if (current_cpu == "arm") { # Don't set the compiler flags for the WebView build. These will come # from the Android build system. if (!is_android_webview_build) { @@ -275,7 +275,7 @@ config("compiler") { ] } } - } else if (cpu_arch == "mipsel") { + } else if (current_cpu == "mipsel") { # Don't set the compiler flags for the WebView build. These will come # from the Android build system. if (!is_android_webview_build) { @@ -302,7 +302,7 @@ config("compiler") { ] } } - } else if (cpu_arch == "mips64el") { + } else if (current_cpu == "mips64el") { # Don't set the compiler flags for the WebView build. These will come # from the Android build system. if (!is_android_webview_build) { @@ -437,7 +437,7 @@ config("compiler") { } # Use gold for Android for most CPU architectures. - if (cpu_arch == "x86" || cpu_arch == "x64" || cpu_arch == "arm") { + if (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm") { ldflags += [ "-fuse-ld=gold" ] if (is_clang) { # Let clang find the ld.gold in the NDK. @@ -459,7 +459,7 @@ config("compiler") { # http://crbug.com/448386 "-Wl,--exclude-libs=libvpx_assembly_arm.a", ] - if (cpu_arch == "arm") { + if (current_cpu == "arm") { ldflags += [ # Enable identical code folding to reduce size. "-Wl,--icf=safe", @@ -467,10 +467,10 @@ config("compiler") { } if (is_clang) { - if (cpu_arch == "arm") { + if (current_cpu == "arm") { cflags += [ "-target arm-linux-androideabi" ] ldflags += [ "-target arm-linux-androideabi" ] - } else if (cpu_arch == "x86") { + } else if (current_cpu == "x86") { cflags += [ "-target x86-linux-androideabi" ] ldflags += [ "-target x86-linux-androideabi" ] } @@ -479,7 +479,7 @@ config("compiler") { } config("compiler_arm_fpu") { - if (cpu_arch == "arm" && !is_android_webview_build) { + if (current_cpu == "arm" && !is_android_webview_build) { cflags = [ "-mfpu=$arm_fpu" ] } } @@ -577,7 +577,7 @@ config("runtime_library") { libs += [ "stlport_static" ] } - if (cpu_arch == "mipsel") { + if (current_cpu == "mipsel") { libs += [ # ld linker is used for mips Android, and ld does not accept library # absolute path prefixed by "-l"; Since libgcc does not exist in mips @@ -844,7 +844,7 @@ config("default_warnings") { # Suppress warnings about ABI changes on ARM (Clang doesn't give this # warning). - if (cpu_arch == "arm" && !is_clang) { + if (current_cpu == "arm" && !is_clang) { cflags += [ "-Wno-psabi" ] } @@ -897,7 +897,7 @@ config("wexit_time_destructors") { # Note that this can be applied regardless of platform and architecture to # clean up the call sites. This will only apply the flag when necessary. config("no_size_t_to_int_warning") { - if (is_win && cpu_arch == "x64") { + if (is_win && current_cpu == "x64") { cflags = [ "/wd4267" ] } } diff --git a/build/config/features.gni b/build/config/features.gni index 3811e27..ba69371 100644 --- a/build/config/features.gni +++ b/build/config/features.gni @@ -74,9 +74,9 @@ enable_print_preview = !is_android # currently. # Do not disable seccomp_bpf anywhere without talking to # security@chromium.org! -use_seccomp_bpf = - (is_linux || is_android) && (cpu_arch == "x86" || cpu_arch == "x64" || - cpu_arch == "arm" || cpu_arch == "mipsel") +use_seccomp_bpf = (is_linux || is_android) && + (current_cpu == "x86" || current_cpu == "x64" || + current_cpu == "arm" || current_cpu == "mipsel") # Enable notifications everywhere except iOS. enable_notifications = !is_ios diff --git a/build/config/linux/pkg_config.gni b/build/config/linux/pkg_config.gni index 631d60a..34ed1af 100644 --- a/build/config/linux/pkg_config.gni +++ b/build/config/linux/pkg_config.gni @@ -43,7 +43,7 @@ if (sysroot != "") { "-s", sysroot, "-a", - cpu_arch, + current_cpu, ] } else if (pkg_config != "") { pkg_config_args = [ diff --git a/build/config/mips.gni b/build/config/mips.gni index f544d94..512552d 100644 --- a/build/config/mips.gni +++ b/build/config/mips.gni @@ -3,11 +3,11 @@ # found in the LICENSE file. # MIPS arch variant. -if (cpu_arch == "mipsel") { +if (current_cpu == "mipsel") { declare_args() { mips_arch_variant = "r1" } -} else if (cpu_arch == "mips64el") { +} else if (current_cpu == "mips64el") { if (is_android) { declare_args() { mips_arch_variant = "r6" diff --git a/build/config/sysroot.gni b/build/config/sysroot.gni index a9b250c..941c77a 100644 --- a/build/config/sysroot.gni +++ b/build/config/sysroot.gni @@ -16,17 +16,17 @@ if (current_toolchain == default_toolchain && target_sysroot != "") { } else if (is_android) { import("//build/config/android/config.gni") if (!is_android_webview_build) { - if (cpu_arch == "x86") { + if (current_cpu == "x86") { sysroot = rebase_path("$android_ndk_root/$x86_android_sysroot_subdir") - } else if (cpu_arch == "arm") { + } else if (current_cpu == "arm") { sysroot = rebase_path("$android_ndk_root/$arm_android_sysroot_subdir") - } else if (cpu_arch == "mipsel") { + } else if (current_cpu == "mipsel") { sysroot = rebase_path("$android_ndk_root/$mips_android_sysroot_subdir") - } else if (cpu_arch == "x64") { + } else if (current_cpu == "x64") { sysroot = rebase_path("$android_ndk_root/$x86_64_android_sysroot_subdir") - } else if (cpu_arch == "arm64") { + } else if (current_cpu == "arm64") { sysroot = rebase_path("$android_ndk_root/$arm64_android_sysroot_subdir") - } else if (cpu_arch == "mips64") { + } else if (current_cpu == "mips64") { sysroot = rebase_path("$android_ndk_root/$mips64_android_sysroot_subdir") } else { sysroot = "" @@ -37,17 +37,17 @@ if (current_toolchain == default_toolchain && target_sysroot != "") { } else if (is_linux && is_chrome_branded && is_official_build && !is_chromeos) { # 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") { + if (current_cpu == "x64") { sysroot = rebase_path("//chrome/installer/linux/debian_wheezy_amd64-sysroot") - } else if (cpu_arch == "x86") { + } else if (current_cpu == "x86") { 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") { + if (current_cpu == "mipsel") { sysroot = rebase_path("//mipsel-sysroot/sysroot") } else { sysroot = "" diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn index 3f05108..201d45b 100644 --- a/build/config/win/BUILD.gn +++ b/build/config/win/BUILD.gn @@ -31,7 +31,7 @@ config("winver") { # Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs. config("sdk_link") { - if (cpu_arch == "x64") { + if (current_cpu == "x64") { ldflags = [ "/MACHINE:X64" ] lib_dirs = [ "$windows_sdk_path\Lib\winv6.3\um\x64", diff --git a/build/secondary/third_party/libjpeg_turbo/BUILD.gn b/build/secondary/third_party/libjpeg_turbo/BUILD.gn index be16302..bf35d07 100644 --- a/build/secondary/third_party/libjpeg_turbo/BUILD.gn +++ b/build/secondary/third_party/libjpeg_turbo/BUILD.gn @@ -5,17 +5,17 @@ # Do not use the targets in this file unless you need a certain libjpeg # implementation. Use the meta target //third_party:jpeg instead. -if (cpu_arch == "arm") { +if (current_cpu == "arm") { import("//build/config/arm.gni") } -if (cpu_arch == "x86" || cpu_arch == "x64") { +if (current_cpu == "x86" || current_cpu == "x64") { import("//third_party/yasm/yasm_assemble.gni") yasm_assemble("simd_asm") { defines = [] - if (cpu_arch == "x86") { + if (current_cpu == "x86") { sources = [ "simd/jccolmmx.asm", "simd/jccolss2.asm", @@ -52,7 +52,7 @@ if (cpu_arch == "x86" || cpu_arch == "x64") { "simd/jsimdcpu.asm", ] defines += [ "__x86__" ] - } else if (cpu_arch == "x64") { + } else if (current_cpu == "x64") { sources = [ "simd/jccolss2-64.asm", "simd/jcgrass2-64.asm", @@ -76,7 +76,7 @@ if (cpu_arch == "x86" || cpu_arch == "x64") { if (is_win) { defines += [ "MSVC" ] include_dirs = [ "win" ] - if (cpu_arch == "x86") { + if (current_cpu == "x86") { defines += [ "WIN32" ] } else { defines += [ "WIN64" ] @@ -92,7 +92,7 @@ if (cpu_arch == "x86" || cpu_arch == "x64") { } source_set("simd") { - if (cpu_arch == "x86") { + if (current_cpu == "x86") { deps = [ ":simd_asm", ] @@ -102,14 +102,14 @@ source_set("simd") { if (is_win) { cflags = [ "/wd4245" ] } - } else if (cpu_arch == "x64") { + } else if (current_cpu == "x64") { deps = [ ":simd_asm", ] sources = [ "simd/jsimd_x86_64.c", ] - } else if (cpu_arch == "arm" && arm_version >= 7 && + } else if (current_cpu == "arm" && arm_version >= 7 && (arm_use_neon || arm_optionally_use_neon)) { sources = [ "simd/jsimd_arm.c", diff --git a/build/secondary/third_party/libsrtp/BUILD.gn b/build/secondary/third_party/libsrtp/BUILD.gn index 506d19f..d9b658e 100644 --- a/build/secondary/third_party/libsrtp/BUILD.gn +++ b/build/secondary/third_party/libsrtp/BUILD.gn @@ -45,7 +45,7 @@ config("libsrtp_config") { ] } - if (cpu_arch == "x64" || cpu_arch == "x86" || cpu_arch == "arm") { + if (current_cpu == "x64" || current_cpu == "x86" || current_cpu == "arm") { defines += [ # TODO(leozwang): CPU_RISC doesn"t work properly on android/arm # platform for unknown reasons, need to investigate the root cause @@ -56,7 +56,7 @@ config("libsrtp_config") { ] } - if (cpu_arch == "mipsel") { + if (current_cpu == "mipsel") { defines += [ "CPU_RISC" ] } } diff --git a/build/secondary/third_party/nss/BUILD.gn b/build/secondary/third_party/nss/BUILD.gn index 1786dc1..ee5f112 100644 --- a/build/secondary/third_party/nss/BUILD.gn +++ b/build/secondary/third_party/nss/BUILD.gn @@ -231,9 +231,7 @@ if (is_linux) { include_dirs = [ "nspr/pr/include/private" ] if (is_win) { - cflags = [ - "/wd4554", # Check precidence. - ] + cflags = [ "/wd4554" ] # Check precidence. defines += [ "XP_PC", "WIN32", @@ -283,9 +281,9 @@ if (is_linux) { ] } - if (cpu_arch == "x86") { + if (current_cpu == "x86") { defines += [ "_X86_" ] - } else if (cpu_arch == "x64") { + } else if (current_cpu == "x64") { defines += [ "_AMD64_" ] } @@ -476,7 +474,7 @@ if (is_linux) { ] } - if (is_win && cpu_arch == "x86") { + if (is_win && current_cpu == "x86") { source_set("nss_static_avx") { sources = [ "nss/lib/freebl/intel-gcm-wrap.c", @@ -906,9 +904,7 @@ if (is_linux) { ] if (is_win) { - cflags += [ - "/wd4101", # Unreferenced local variable. - ] + cflags += [ "/wd4101" ] # Unreferenced local variable. } if (include_nss_libpkix) { @@ -1098,7 +1094,7 @@ if (is_linux) { defines += [ "NSS_DISABLE_ROOT_CERTS" ] } - if (cpu_arch == "x64" && !is_win) { + if (current_cpu == "x64" && !is_win) { sources -= [ "nss/lib/freebl/chacha20/chacha20.c", "nss/lib/freebl/poly1305/poly1305.c", @@ -1143,7 +1139,7 @@ if (is_linux) { "WIN95", ] - if (cpu_arch == "x86") { + if (current_cpu == "x86") { defines += [ "NSS_X86_OR_X64", "NSS_X86", @@ -1157,7 +1153,7 @@ if (is_linux) { "INTEL_GCM", ] sources -= [ "nss/lib/freebl/mpi/mpi_amd64.c" ] - } else if (cpu_arch == "x64") { + } else if (current_cpu == "x64") { sources -= [ "nss/lib/freebl/intel-aes-x86-masm.asm", "nss/lib/freebl/mpi/mpi_amd64.c", @@ -1208,7 +1204,7 @@ if (is_linux) { "//third_party/sqlite", ] - if (is_win && cpu_arch == "x86") { + if (is_win && current_cpu == "x86") { deps += [ ":nss_static_avx" ] } } diff --git a/build/toolchain/android/BUILD.gn b/build/toolchain/android/BUILD.gn index e24521d..53ad506 100644 --- a/build/toolchain/android/BUILD.gn +++ b/build/toolchain/android/BUILD.gn @@ -18,7 +18,7 @@ import("//build/toolchain/gcc_toolchain.gni") # Subdirectory inside of android_ndk_sysroot where libs go. # - tool_prefix # Prefix to be added to the tool names. -# - toolchain_cpu_arch +# - toolchain_cpu # Same as gcc_toolchain template("android_gcc_toolchain") { gcc_toolchain(target_name) { diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni index 7dd2e94..5f49f68 100644 --- a/build/toolchain/gcc_toolchain.gni +++ b/build/toolchain/gcc_toolchain.gni @@ -14,10 +14,10 @@ concurrent_links = exec_script("get_concurrent_links.py", [], "value") # - ar # - ld # and the following which is used in the toolchain_args -# - toolchain_cpu_arch (What "cpu_arch" should be set to when invoking a -# build using this toolchain.) -# - toolchain_os (What "os" should be set to when invoking a build using this -# toolchain.) +# - toolchain_cpu (What "current_cpu" should be set to when invoking a +# build using this toolchain.) +# - toolchain_os (What "current_os" should be set to when invoking a +# build using this toolchain.) # # Optional parameters: # - libs_section_prefix diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn index 32cab35..18ee8b8 100644 --- a/build/toolchain/mac/BUILD.gn +++ b/build/toolchain/mac/BUILD.gn @@ -204,7 +204,7 @@ template("mac_clang_toolchain") { # Toolchain representing the target build (either mac or iOS). mac_clang_toolchain("clang") { - toolchain_os = os + toolchain_os = current_os } # This toolchain provides a way for iOS target compiles to reference targets diff --git a/build/toolchain/nacl/BUILD.gn b/build/toolchain/nacl/BUILD.gn index b923608..5fa637c 100644 --- a/build/toolchain/nacl/BUILD.gn +++ b/build/toolchain/nacl/BUILD.gn @@ -54,7 +54,7 @@ toolchain("x86_newlib") { toolchain_args() { # Override the default OS detection. The build config will set the is_* # flags accordingly. - os = "nacl" + current_os = "nacl" # Component build not supported in NaCl, since it does not support shared # libraries. diff --git a/build/toolchain/win/BUILD.gn b/build/toolchain/win/BUILD.gn index 099d91a..e9461a4 100644 --- a/build/toolchain/win/BUILD.gn +++ b/build/toolchain/win/BUILD.gn @@ -31,7 +31,7 @@ toolchain_data = exec_script("setup_toolchain.py", gyp_win_tool_path, windows_sdk_path, visual_studio_runtime_dirs, - cpu_arch, + current_cpu, ], "scope") @@ -43,7 +43,7 @@ if (vc_bin_dir == "") { concurrent_links = exec_script("../get_concurrent_links.py", [], "value") # Parameters: -# cpu_arch: cpu_arch to pass as a build arg +# current_cpu: current_cpu to pass as a build arg # environment: File name of environment file. template("msvc_toolchain") { if (defined(invoker.concurrent_links)) { @@ -62,7 +62,7 @@ template("msvc_toolchain") { "copy_dlls", rebase_path(root_build_dir), configuration, - invoker.cpu_arch, + invoker.current_cpu, ]) if (use_goma) { @@ -212,7 +212,7 @@ template("msvc_toolchain") { # get it sorted out how we want to support them both in a single build. # Right now only one of these can be enabled at a time because the # runtime libraries get copied to root_build_dir and would collide. -if (cpu_arch == "x86") { +if (current_cpu == "x86") { msvc_toolchain("32") { environment = "environment.x86" @@ -220,7 +220,7 @@ if (cpu_arch == "x86") { } } -if (cpu_arch == "x64") { +if (current_cpu == "x64") { msvc_toolchain("64") { environment = "environment.x64" diff --git a/build/toolchain/win/midl.gni b/build/toolchain/win/midl.gni index ce310d1..30bcbf7 100644 --- a/build/toolchain/win/midl.gni +++ b/build/toolchain/win/midl.gni @@ -56,10 +56,10 @@ template("midl") { "$out_dir/$proxy_file", ] - if (cpu_arch == "x86") { + if (current_cpu == "x86") { win_tool_arch = "environment.x86" idl_target_platform = "win32" - } else if (cpu_arch == "x64") { + } else if (current_cpu == "x64") { win_tool_arch = "environment.x64" idl_target_platform = "x64" } else { diff --git a/build/toolchain/win/setup_toolchain.py b/build/toolchain/win/setup_toolchain.py index cc89638..bc9bd1e 100644 --- a/build/toolchain/win/setup_toolchain.py +++ b/build/toolchain/win/setup_toolchain.py @@ -51,23 +51,23 @@ def _ExtractImportantEnvironment(output_of_set): return env -def _SetupScript(target_arch, sdk_dir): +def _SetupScript(target_cpu, sdk_dir): """Returns a command (with arguments) to be used to set up the environment.""" # Check if we are running in the SDK command line environment and use - # the setup script from the SDK if so. |target_arch| should be either + # the setup script from the SDK if so. |target_cpu| should be either # 'x86' or 'x64'. - assert target_arch in ('x86', 'x64') + assert target_cpu in ('x86', 'x64') if bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', 1))) and sdk_dir: return [os.path.normpath(os.path.join(sdk_dir, 'Bin/SetEnv.Cmd')), - '/' + target_arch] + '/' + target_cpu] else: # We only support x64-hosted tools. # TODO(scottmg|dpranke): Non-depot_tools toolchain: need to get Visual # Studio install location from registry. return [os.path.normpath(os.path.join(os.environ['GYP_MSVS_OVERRIDE_PATH'], 'VC/vcvarsall.bat')), - 'amd64_x86' if target_arch == 'x86' else 'amd64'] + 'amd64_x86' if target_cpu == 'x86' else 'amd64'] def _FormatAsEnvironmentBlock(envvar_dict): @@ -100,25 +100,25 @@ def main(): if len(sys.argv) != 6: print('Usage setup_toolchain.py ' '<visual studio path> <win tool path> <win sdk path> ' - '<runtime dirs> <cpu_arch>') + '<runtime dirs> <target_cpu>') sys.exit(2) tool_source = sys.argv[2] win_sdk_path = sys.argv[3] runtime_dirs = sys.argv[4] - cpu_arch = sys.argv[5] + target_cpu = sys.argv[5] _CopyTool(tool_source) - archs = ('x86', 'x64') - assert cpu_arch in archs + cpus = ('x86', 'x64') + assert target_cpu in cpus vc_bin_dir = '' # TODO(scottmg|goma): Do we need an equivalent of # ninja_use_custom_environment_files? - for arch in archs: + for cpu in cpus: # Extract environment variables for subprocesses. - args = _SetupScript(arch, win_sdk_path) + args = _SetupScript(cpu, win_sdk_path) args.extend(('&&', 'set')) popen = subprocess.Popen( args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) @@ -126,7 +126,7 @@ def main(): env = _ExtractImportantEnvironment(variables) env['PATH'] = runtime_dirs + ';' + env['PATH'] - if arch == cpu_arch: + if cpu == target_cpu: for path in env['PATH'].split(os.pathsep): if os.path.exists(os.path.join(path, 'cl.exe')): vc_bin_dir = os.path.realpath(path) @@ -143,7 +143,7 @@ def main(): sdk_dir=win_sdk_path) env['INCLUDE'] = additional_includes + env['INCLUDE'] env_block = _FormatAsEnvironmentBlock(env) - with open('environment.' + arch, 'wb') as f: + with open('environment.' + cpu, 'wb') as f: f.write(env_block) assert vc_bin_dir diff --git a/build/vs_toolchain.py b/build/vs_toolchain.py index 6f49e7c..5b175eb 100644 --- a/build/vs_toolchain.py +++ b/build/vs_toolchain.py @@ -129,11 +129,11 @@ def CopyVsRuntimeDlls(output_dir, runtime_dirs): source_x64) -def CopyDlls(target_dir, configuration, cpu_arch): +def CopyDlls(target_dir, configuration, target_cpu): """Copy the VS runtime DLLs into the requested directory as needed. configuration is one of 'Debug' or 'Release'. - cpu_arch is one of 'x86' or 'x64'. + target_cpu is one of 'x86' or 'x64'. The debug configuration gets both the debug and release DLLs; the release config only the latter. @@ -143,7 +143,7 @@ def CopyDlls(target_dir, configuration, cpu_arch): return x64_runtime, x86_runtime = vs2013_runtime_dll_dirs - runtime_dir = x64_runtime if cpu_arch == 'x64' else x86_runtime + runtime_dir = x64_runtime if target_cpu == 'x64' else x86_runtime _CopyRuntime(target_dir, runtime_dir, 'msvc%s120.dll') if configuration == 'Debug': _CopyRuntime(target_dir, runtime_dir, 'msvc%s120d.dll') diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn index 2ef9bdde..30b14e4 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -198,7 +198,7 @@ if (!is_win || link_chrome_on_windows) { if (enable_configuration_policy) { deps += [ "//components/policy" ] } - if (cpu_arch == "x86") { + if (current_cpu == "x86") { # Add a dependency to custom import library for user32 delay imports only # in x86 builds. #deps += [ 'chrome_user32_delay_imports' ] TODO(GYP) diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 49909a8..b744411 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn @@ -1513,7 +1513,7 @@ if (!is_android && (!is_win || link_chrome_on_windows)) { # static for simplicity. deps += [ "//third_party/cld_2:cld2_static" ] } - if (is_desktop_linux && cpu_arch == "x64") { + if (is_desktop_linux && current_cpu == "x64") { # Only add this test for 64 bit builds because otherwise we need the 32 # bit library on 64 bit systems when running this test. sources += @@ -1534,7 +1534,7 @@ if (!is_android && (!is_win || link_chrome_on_windows)) { "//ui/aura:test_support", ] } - if (is_linux && is_chrome_branded && cpu_arch == "x86") { + if (is_linux && is_chrome_branded && current_cpu == "x86") { ldflags = [ "-Wl,--strip-debug" ] } if (is_mac) { diff --git a/chrome_elf/BUILD.gn b/chrome_elf/BUILD.gn index b58c829..74a217f 100644 --- a/chrome_elf/BUILD.gn +++ b/chrome_elf/BUILD.gn @@ -32,7 +32,7 @@ shared_library("chrome_elf") { "/NODEFAULTLIB:user32.lib", "/DEF:" + rebase_path("chrome_elf.def"), ] - if (cpu_arch == "x86") { + if (current_cpu == "x86") { # Don"t set an x64 base address (to avoid breaking HE-ASLR). ldflags += [ "/BASE:0x01c20000" ] } @@ -96,7 +96,7 @@ if (is_component_build) { configs += [ "//build/config/win:windowed" ] ldflags = [ "/DEF:" + rebase_path("chrome_redirects.def") ] - if (cpu_arch == "x86") { + if (current_cpu == "x86") { # Don't set an x64 base address (to avoid breaking HE-ASLR). ldflags += [ "/BASE:0x01c20000" ] } diff --git a/components/policy/BUILD.gn b/components/policy/BUILD.gn index 632cbe6..c8266de 100644 --- a/components/policy/BUILD.gn +++ b/components/policy/BUILD.gn @@ -89,7 +89,7 @@ if (enable_configuration_policy) { app_resources_path, ] - if (os != "android") { + if (current_os != "android") { outputs -= [ app_restrictions_path, app_resources_path, @@ -111,7 +111,7 @@ if (enable_configuration_policy) { rebase_path(app_restrictions_path, root_build_dir), "--app-restrictions-resources=" + rebase_path(app_resources_path, root_build_dir), - os, + current_os, chromeos_flag, rebase_path("resources/policy_templates.json", root_build_dir), ] diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn index 9ca66d2..b311783 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn @@ -7,7 +7,7 @@ import("//build/config/ui.gni") import("//content/common/common.gni") import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni") -if (is_chromeos && cpu_arch != "arm") { +if (is_chromeos && current_cpu != "arm") { action("libva_generate_stubs") { extra_header = "gpu/media/va_stub_header.fragment" @@ -282,7 +282,7 @@ source_set("common") { include_dirs += [ "//third_party/khronos" ] configs += [ "//build/config/linux:xcomposite" ] - if (cpu_arch != "arm" || !is_chromeos) { + if (current_cpu != "arm" || !is_chromeos) { sources += [ "gpu/x_util.cc", "gpu/x_util.h", @@ -355,13 +355,13 @@ source_set("common") { "GLESv2", ] } - if (cpu_arch == "arm") { + if (current_cpu == "arm") { sources += [ "gpu/media/tegra_v4l2_video_device.cc", "gpu/media/tegra_v4l2_video_device.h", ] } - if (cpu_arch != "arm") { + if (current_cpu != "arm") { sources += [ "gpu/media/va_surface.h", "gpu/media/vaapi_h264_decoder.cc", @@ -457,7 +457,7 @@ source_set("common") { } } - if (is_win && cpu_arch == "x64") { + if (is_win && current_cpu == "x64") { # TODO(jschuh): Remove this after crbug.com/173851 gets fixed. cflags = [ "/bigobj" ] } diff --git a/content/gpu/BUILD.gn b/content/gpu/BUILD.gn index 1056468..d43bb82 100644 --- a/content/gpu/BUILD.gn +++ b/content/gpu/BUILD.gn @@ -43,7 +43,7 @@ source_set("gpu") { ] } - if (is_chromeos && cpu_arch != "arm") { + if (is_chromeos && current_cpu != "arm") { configs += [ "//third_party/libva:libva_config" ] } diff --git a/content/shell/android/BUILD.gn b/content/shell/android/BUILD.gn index 210c0f1..9f1a7fa 100644 --- a/content/shell/android/BUILD.gn +++ b/content/shell/android/BUILD.gn @@ -168,7 +168,7 @@ android_apk("content_shell_test_apk") { android_manifest = "javatests/AndroidManifest.xml" } -if (cpu_arch != "x64" && cpu_arch != "arm64") { +if (current_cpu != "x64" && current_cpu != "arm64") { chromium_linker_test_manifest = "$target_gen_dir/linker_test_apk/AndroidManifest.xml" diff --git a/courgette/BUILD.gn b/courgette/BUILD.gn index f479ea9..af81012b 100644 --- a/courgette/BUILD.gn +++ b/courgette/BUILD.gn @@ -58,7 +58,7 @@ static_library("courgette_lib") { } executable("courgette") { - if (is_win && cpu_arch == "x64") { + if (is_win && current_cpu == "x64") { # The build infrastructure needs courgette to be named courgette64. output_name = "courgette64" } diff --git a/media/BUILD.gn b/media/BUILD.gn index 1e7da3f..9ab1e72 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -20,7 +20,7 @@ config("media_config") { if (!media_use_ffmpeg) { defines += [ "MEDIA_DISABLE_FFMPEG" ] } - if (cpu_arch == "arm" && arm_use_neon) { + if (current_cpu == "arm" && arm_use_neon) { defines += [ "USE_NEON" ] } if (use_pulseaudio) { @@ -254,6 +254,7 @@ component("media") { configs += [ ":media_config", + # TODO(wolenetz): Fix size_t to int trunctaion in win64. # See http://crbug.com/171009 "//build/config/compiler:no_size_t_to_int_warning", @@ -297,7 +298,7 @@ component("media") { } } - if (cpu_arch == "arm" && arm_use_neon) { + if (current_cpu == "arm" && arm_use_neon) { defines += [ "USE_NEON" ] } @@ -342,7 +343,7 @@ component("media") { } } - if (cpu_arch != "arm" && is_chromeos) { + if (current_cpu != "arm" && is_chromeos) { sources += [ "filters/h264_bitstream_buffer.cc", "filters/h264_bitstream_buffer.h", @@ -625,7 +626,7 @@ test("media_unittests") { ] } - if (cpu_arch != "arm" && is_chromeos) { + if (current_cpu != "arm" && is_chromeos) { sources += [ "filters/h264_bitstream_buffer_unittest.cc" ] } diff --git a/media/base/BUILD.gn b/media/base/BUILD.gn index 0fb3b1c..4a327bf 100644 --- a/media/base/BUILD.gn +++ b/media/base/BUILD.gn @@ -242,7 +242,7 @@ source_set("base") { defines += [ "DISABLE_USER_INPUT_MONITOR" ] } - if (cpu_arch == "x86" || cpu_arch == "x64") { + if (current_cpu == "x86" || current_cpu == "x64") { sources += [ "simd/convert_yuv_to_rgb_x86.cc" ] deps += [ ":media_yasm", @@ -373,7 +373,7 @@ source_set("unittests") { deps += [ "//ui/gl" ] } - if (cpu_arch == "x86" || cpu_arch == "x64") { + if (current_cpu == "x86" || current_cpu == "x64") { sources += [ "simd/convert_rgb_to_yuv_unittest.cc" ] } } @@ -405,7 +405,7 @@ source_set("perftests") { } } -if (cpu_arch == "x86" || cpu_arch == "x64") { +if (current_cpu == "x86" || current_cpu == "x64") { source_set("media_sse2") { sources = [ "simd/convert_rgb_to_yuv_sse2.cc", @@ -452,9 +452,9 @@ if (cpu_arch == "x86" || cpu_arch == "x64") { "simd/scale_yuv_to_rgb_mmx.inc", ] - if (cpu_arch == "x86") { + if (current_cpu == "x86") { yasm_flags += [ "-DARCH_X86_32" ] - } else if (cpu_arch == "x64") { + } else if (current_cpu == "x64") { yasm_flags += [ "-DARCH_X86_64" ] sources += [ "simd/linear_scale_yuv_to_rgb_mmx_x64.asm", @@ -470,7 +470,7 @@ if (cpu_arch == "x86" || cpu_arch == "x64") { } else { if (is_posix) { yasm_flags += [ "-DELF" ] - if (cpu_arch == "x64") { + if (current_cpu == "x64") { # TODO(ajwong): Why isn't this true in mac? yasm_flags += [ "-DPIC" ] } diff --git a/mojo/nacl/BUILD.gn b/mojo/nacl/BUILD.gn index 0b626bc..222d45f 100644 --- a/mojo/nacl/BUILD.gn +++ b/mojo/nacl/BUILD.gn @@ -109,7 +109,7 @@ if (is_nacl) { group("mojo_nacl") { deps = [ - ":irt_mojo(//native_client/build/toolchain/nacl:irt_${cpu_arch})", + ":irt_mojo(//native_client/build/toolchain/nacl:irt_${current_cpu})", ] } @@ -117,6 +117,6 @@ group("mojo_nacl_tests") { testonly = true deps = [ ":monacl_shell", - ":monacl_test(//native_client/build/toolchain/nacl:clang_newlib_${cpu_arch})", + ":monacl_test(//native_client/build/toolchain/nacl:clang_newlib_${current_cpu})", ] } diff --git a/net/BUILD.gn b/net/BUILD.gn index 6b9c93e..ab6b9e0 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn @@ -38,7 +38,7 @@ use_kerberos = !is_chromeos && !is_android && !is_ios # pretty confident that mmap-ing the index would not hurt any existing x86 # android devices, but we cannot be so sure about the variety of ARM devices. # So enable it for x86 only for now. -posix_avoid_mmap = is_android && cpu_arch != "x86" +posix_avoid_mmap = is_android && current_cpu != "x86" # WebSockets and socket stream code are used everywhere except iOS. enable_websockets = !is_ios @@ -75,6 +75,7 @@ component("net") { "DLOPEN_KERBEROS", "NET_IMPLEMENTATION", ] + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] public_configs = [ ":net_config" ] @@ -820,6 +821,7 @@ if (!is_ios && !is_android) { sources = [ "tools/crash_cache/crash_cache.cc", ] + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] deps = [ @@ -834,6 +836,7 @@ if (!is_ios && !is_android) { sources = [ "tools/crl_set_dump/crl_set_dump.cc", ] + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] deps = [ @@ -847,6 +850,7 @@ if (!is_ios && !is_android) { sources = [ "tools/dns_fuzz_stub/dns_fuzz_stub.cc", ] + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] deps = [ @@ -872,6 +876,7 @@ if (!is_ios && !is_android) { sources = [ "tools/get_server_time/get_server_time.cc", ] + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] deps = [ @@ -924,6 +929,7 @@ if (!is_ios && !is_android) { sources = [ "disk_cache/blockfile/stress_cache.cc", ] + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] deps = [ @@ -937,6 +943,7 @@ if (!is_ios && !is_android) { sources = [ "tools/tld_cleanup/tld_cleanup.cc", ] + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] deps = [ diff --git a/ppapi/shared_impl/BUILD.gn b/ppapi/shared_impl/BUILD.gn index 8595ae39..a70e0cf 100644 --- a/ppapi/shared_impl/BUILD.gn +++ b/ppapi/shared_impl/BUILD.gn @@ -143,7 +143,7 @@ component("shared_impl") { # nacl_win64 build (cross-compiled for a 32-bit Chrome), rather than the # native 64-bit Chrome build. # See also //ppapi/thunk - if (is_win && cpu_arch == "x64" && current_toolchain != default_toolchain) { + if (is_win && current_cpu == "x64" && current_toolchain != default_toolchain) { sources -= [ "ppb_audio_shared.cc", "ppb_graphics_3d_shared.cc", diff --git a/ppapi/thunk/BUILD.gn b/ppapi/thunk/BUILD.gn index 2dee0d7..6226b48 100644 --- a/ppapi/thunk/BUILD.gn +++ b/ppapi/thunk/BUILD.gn @@ -179,7 +179,7 @@ source_set("thunk") { # nacl_win64 build (cross-compiled for a 32-bit Chrome), rather than all # 64-bit builds. # See also //ppapi/shared_impl - if (is_win && cpu_arch == "x64" && current_toolchain != default_toolchain) { + if (is_win && current_cpu == "x64" && current_toolchain != default_toolchain) { sources += [ "ppb_graphics_3d_thunk.cc", "ppb_host_resolver_private_thunk.cc", diff --git a/remoting/resources/BUILD.gn b/remoting/resources/BUILD.gn index 0328231..848f9c2 100644 --- a/remoting/resources/BUILD.gn +++ b/remoting/resources/BUILD.gn @@ -203,7 +203,7 @@ action("copy_locales") { args = [ "-p", - os, + current_os, "-g", rebase_path(root_gen_dir, root_build_dir), "-x", diff --git a/sandbox/linux/BUILD.gn b/sandbox/linux/BUILD.gn index 8b18a3a..c4a851e 100644 --- a/sandbox/linux/BUILD.gn +++ b/sandbox/linux/BUILD.gn @@ -11,7 +11,7 @@ declare_args() { compile_credentials = is_linux compile_seccomp_bpf_demo = - is_linux && (cpu_arch == "x86" || cpu_arch == "x64") + is_linux && (current_cpu == "x86" || current_cpu == "x64") } # We have two principal targets: sandbox and sandbox_linux_unittests diff --git a/sandbox/win/BUILD.gn b/sandbox/win/BUILD.gn index d4d6496..ac87fa5 100644 --- a/sandbox/win/BUILD.gn +++ b/sandbox/win/BUILD.gn @@ -135,7 +135,7 @@ source_set("sandbox") { "src/window.h", ] - if (cpu_arch == "x64") { + if (current_cpu == "x64") { sources += [ "src/interceptors_64.cc", "src/interceptors_64.h", @@ -143,7 +143,7 @@ source_set("sandbox") { "src/service_resolver_64.cc", "src/Wow64_64.cc", ] - } else if (cpu_arch == "x86") { + } else if (current_cpu == "x86") { sources += [ "src/resolver_32.cc", "src/service_resolver_32.cc", @@ -164,12 +164,12 @@ source_set("sandbox") { deps = [ "//base", ] - if (cpu_arch == "x86") { + if (current_cpu == "x86") { deps += [ ":copy_wow_helper" ] } } -if (cpu_arch == "x86") { +if (current_cpu == "x86") { # Make a target that copies the wow_helper files to the out dir. # # TODO(brettw) we can probably just build this now that we have proper diff --git a/skia/BUILD.gn b/skia/BUILD.gn index c793e0b..90a25f5 100644 --- a/skia/BUILD.gn +++ b/skia/BUILD.gn @@ -5,7 +5,7 @@ import("//build/config/features.gni") import("//build/config/ui.gni") import("//testing/test.gni") -if (cpu_arch == "arm") { +if (current_cpu == "arm") { import("//build/config/arm.gni") } @@ -191,7 +191,7 @@ config("skia_library_config") { defines += [ "SKIA_IMPLEMENTATION=1" ] } - if (cpu_arch == "arm") { + if (current_cpu == "arm") { if (arm_use_neon) { defines += [ "SK_ARM_HAS_NEON" ] } @@ -311,7 +311,7 @@ component("skia") { sources += gypi_skia_utils.sources sources += gypi_values.skia_library_sources - if (cpu_arch == "arm") { + if (current_cpu == "arm") { sources += [ "//third_party/skia/src/core/SkUtilsArm.cpp", "//third_party/skia/src/core/SkUtilsArm.h", @@ -545,7 +545,7 @@ source_set("skia_opts") { cflags = [] defines = [] - if (cpu_arch == "x86" || cpu_arch == "x64") { + if (current_cpu == "x86" || current_cpu == "x64") { sources = gypi_skia_opts.sse2_sources + gypi_skia_opts.ssse3_sources + gypi_skia_opts.sse41_sources + [ @@ -556,7 +556,7 @@ source_set("skia_opts") { if (is_linux || is_mac) { cflags += [ "-msse4.1" ] } - } else if (cpu_arch == "arm") { + } else if (current_cpu == "arm") { # The assembly uses the frame pointer register (r7 in Thumb/r11 in # ARM), the compiler doesn't like that. cflags += [ "-fomit-frame-pointer" ] @@ -576,7 +576,7 @@ source_set("skia_opts") { } else { sources = gypi_skia_opts.none_sourcees } - } else if (cpu_arch == "mipsel") { + } else if (current_cpu == "mipsel") { cflags += [ "-fomit-frame-pointer" ] sources = gypi_skia_opts.none_sources } else { diff --git a/third_party/adobe/flash/BUILD.gn b/third_party/adobe/flash/BUILD.gn index b618ffb..7a5c99a 100644 --- a/third_party/adobe/flash/BUILD.gn +++ b/third_party/adobe/flash/BUILD.gn @@ -3,37 +3,37 @@ # found in the LICENSE file. if (is_chrome_branded) { - if (is_linux && cpu_arch == "x86") { + if (is_linux && current_cpu == "x86") { flapper_version_h_file = "symbols/ppapi/linux/flapper_version.h" flapper_binary_files = [ "binaries/ppapi/linux/libpepflashplayer.so", "binaries/ppapi/linux/manifest.json", ] - } else if (is_linux && cpu_arch == "x64") { + } else if (is_linux && current_cpu == "x64") { flapper_version_h_file = "symbols/ppapi/linux_x64/flapper_version.h" flapper_binary_files = [ "binaries/ppapi/linux_x64/libpepflashplayer.so", "binaries/ppapi/linux_x64/manifest.json", ] - } else if (is_mac && cpu_arch == "x86") { + } else if (is_mac && current_cpu == "x86") { flapper_version_h_file = "symbols/ppapi/mac/flapper_version.h" flapper_binary_files = [ "binaries/ppapi/mac/PepperFlashPlayer.plugin", "binaries/ppapi/mac/manifest.json", ] - } else if (is_mac && cpu_arch == "x64") { + } else if (is_mac && current_cpu == "x64") { flapper_version_h_file = "symbols/ppapi/mac_64/flapper_version.h" flapper_binary_files = [ "binaries/ppapi/mac_64/PepperFlashPlayer.plugin", "binaries/ppapi/mac_64/manifest.json", ] - } else if (is_win && cpu_arch == "x86") { + } else if (is_win && current_cpu == "x86") { flapper_version_h_file = "symbols/ppapi/win/flapper_version.h" flapper_binary_files = [ "binaries/ppapi/win/pepflashplayer.dll", "binaries/ppapi/win/manifest.json", ] - } else if (is_win && cpu_arch == "x64") { + } else if (is_win && current_cpu == "x64") { flapper_version_h_file = "symbols/ppapi/win_x64/flapper_version.h" flapper_binary_files = [ "binaries/ppapi/win_x64/pepflashplayer.dll", diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn index 9c75f1b..e147754 100644 --- a/third_party/boringssl/BUILD.gn +++ b/third_party/boringssl/BUILD.gn @@ -28,9 +28,9 @@ gypi_values = if (is_win) { import("//third_party/yasm/yasm_assemble.gni") yasm_assemble("boringssl_asm") { - if (cpu_arch == "x64") { + if (current_cpu == "x64") { sources = gypi_values.boringssl_win_x86_64_sources - } else if (cpu_arch == "x86") { + } else if (current_cpu == "x86") { sources = gypi_values.boringssl_win_x86_sources } } @@ -54,6 +54,7 @@ component("boringssl") { configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code", + # TODO(davidben): Fix size_t truncations in BoringSSL. # https://crbug.com/429039 "//build/config/compiler:no_size_t_to_int_warning", @@ -69,7 +70,7 @@ component("boringssl") { "src/crypto", ] - if (cpu_arch == "x64") { + if (current_cpu == "x64") { if (is_mac) { sources += gypi_values.boringssl_mac_x86_64_sources } else if (is_linux || is_android) { @@ -79,7 +80,7 @@ component("boringssl") { } else { defines += [ "OPENSSL_NO_ASM" ] } - } else if (cpu_arch == "x86") { + } else if (current_cpu == "x86") { if (is_mac) { sources += gypi_values.boringssl_mac_x86_sources } else if (is_linux || is_android) { @@ -89,9 +90,9 @@ component("boringssl") { } else { defines += [ "OPENSSL_NO_ASM" ] } - } else if (cpu_arch == "arm") { + } else if (current_cpu == "arm") { sources += gypi_values.boringssl_linux_arm_sources - } else if (cpu_arch == "arm64") { + } else if (current_cpu == "arm64") { sources += gypi_values.boringssl_linux_aarch64_sources } else { defines += [ "OPENSSL_NO_ASM" ] diff --git a/third_party/harfbuzz-ng/BUILD.gn b/third_party/harfbuzz-ng/BUILD.gn index 6e93e04..71213fd 100644 --- a/third_party/harfbuzz-ng/BUILD.gn +++ b/third_party/harfbuzz-ng/BUILD.gn @@ -28,7 +28,7 @@ declare_args() { } else { use_system_harfbuzz = false } - if (is_linux && cpu_arch == "arm" && !is_chromeos) { + if (is_linux && current_cpu == "arm" && !is_chromeos) { # Override use_system_harfbuzz for ARM cross compiling so system # harfbuzz is not used because the corresponding package is not # available. @@ -161,9 +161,7 @@ if (use_system_harfbuzz) { cflags += [ "-Wno-unused-value" ] } if (is_win) { - cflags += [ - "/wd4334", # Result of 32-bit shift implicitly converted to 64 bits. - ] + cflags += [ "/wd4334" ] # Result of 32-bit shift implicitly converted to 64 bits. } if (is_mac) { sources += [ diff --git a/third_party/libjingle/BUILD.gn b/third_party/libjingle/BUILD.gn index fc13ff1..dae2bce 100644 --- a/third_party/libjingle/BUILD.gn +++ b/third_party/libjingle/BUILD.gn @@ -36,7 +36,7 @@ config("jingle_unexported_configs") { # Assumes libpeer is linked statically. defines += [ "LIBPEERCONNECTION_LIB=1" ] - if (is_win && cpu_arch == "x86") { + if (is_win && current_cpu == "x86") { defines += [ "_USE_32BIT_TIME_T" ] } diff --git a/third_party/libwebp/BUILD.gn b/third_party/libwebp/BUILD.gn index 72a6903..5495e64 100644 --- a/third_party/libwebp/BUILD.gn +++ b/third_party/libwebp/BUILD.gn @@ -9,8 +9,8 @@ config("libwebp_config") { } use_dsp_neon = - cpu_arch == "arm64" || (cpu_arch == "arm" && arm_version >= 7 && - (arm_use_neon || arm_optionally_use_neon)) + current_cpu == "arm64" || (current_cpu == "arm" && arm_version >= 7 && + (arm_use_neon || arm_optionally_use_neon)) source_set("libwebp_dec") { sources = [ @@ -102,11 +102,11 @@ if (use_dsp_neon) { include_dirs = [ "." ] - if (cpu_arch == "arm") { + if (current_cpu == "arm") { # behavior similar to *.c.neon in an Android.mk configs -= [ "//build/config/compiler:compiler_arm_fpu" ] cflags = [ "-mfpu=neon" ] - } else if (cpu_arch == "arm64") { + } else if (current_cpu == "arm64") { # avoid an ICE with gcc-4.9: b/15574841 cflags = [ "-frename-registers" ] } diff --git a/third_party/opus/BUILD.gn b/third_party/opus/BUILD.gn index 244ddcd..fefba04 100644 --- a/third_party/opus/BUILD.gn +++ b/third_party/opus/BUILD.gn @@ -6,15 +6,15 @@ import("//build/config/arm.gni") import("//testing/test.gni") # If fixed point implementation shall be used (otherwise float). -use_opus_fixed_point = cpu_arch == "arm" || cpu_arch == "arm64" +use_opus_fixed_point = current_cpu == "arm" || current_cpu == "arm64" # If ARM optimizations shall be used to accelerate performance. -use_opus_arm_optimization = cpu_arch == "arm" +use_opus_arm_optimization = current_cpu == "arm" # If OPUS Run Time CPU Detections (RTCD) shall be used. # Based on the conditions in celt/arm/armcpu.c: # defined(_MSC_VER) || defined(__linux__). -use_opus_rtcd = cpu_arch == "arm" && (is_win || is_android || is_linux) +use_opus_rtcd = current_cpu == "arm" && (is_win || is_android || is_linux) config("opus_config") { include_dirs = [ "src/include" ] @@ -97,7 +97,8 @@ source_set("opus") { cflags = [ "-Wno-#pragma-messages" ] } - if (!is_debug && is_posix && (cpu_arch == "arm" || cpu_arch == "arm64")) { + if (!is_debug && is_posix && + (current_cpu == "arm" || current_cpu == "arm64")) { configs -= [ "//build/config/compiler:optimize" ] configs += [ "//build/config/compiler:optimize_max" ] } diff --git a/third_party/qcms/BUILD.gn b/third_party/qcms/BUILD.gn index b059319..ee62b8e 100644 --- a/third_party/qcms/BUILD.gn +++ b/third_party/qcms/BUILD.gn @@ -25,10 +25,10 @@ source_set("qcms") { configs += [ "//build/config/compiler:no_chromium_code" ] public_configs = [ ":qcms_config" ] - if (cpu_arch == "x86" || cpu_arch == "x64") { + if (current_cpu == "x86" || current_cpu == "x64") { defines = [ "SSE2_ENABLE" ] sources += [ "src/transform-sse2.c" ] - if (!(is_win && cpu_arch == "x64")) { + if (!(is_win && current_cpu == "x64")) { # QCMS assumes this target isn't compiled since MSVC x64 doesn't support # the MMX intrinsics present in the SSE1 code. sources += [ "src/transform-sse1.c" ] diff --git a/third_party/widevine/cdm/BUILD.gn b/third_party/widevine/cdm/BUILD.gn index b563eb4..aa476af1 100644 --- a/third_party/widevine/cdm/BUILD.gn +++ b/third_party/widevine/cdm/BUILD.gn @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -widevine_arch = cpu_arch +widevine_arch = current_cpu if (widevine_arch == "x86") { widevine_arch = "ia32" } diff --git a/third_party/yasm/BUILD.gn b/third_party/yasm/BUILD.gn index 3c5215e..a09a495 100644 --- a/third_party/yasm/BUILD.gn +++ b/third_party/yasm/BUILD.gn @@ -30,18 +30,14 @@ if (current_toolchain == host_toolchain) { # Various files referenced by multiple targets. yasm_gen_include_dir = "$target_gen_dir/include" - yasm_os = os - if (is_chromeos) { - yasm_os = "linux" - } - config_makefile = "source/config/$yasm_os/Makefile" + config_makefile = "source/config/$host_os/Makefile" version_file = "version.mac" import("//build/compiled_action.gni") config("yasm_config") { include_dirs = [ - "source/config/$yasm_os", + "source/config/$host_os", "source/patched-yasm", ] defines = [ "HAVE_CONFIG_H" ] diff --git a/third_party/yasm/yasm_assemble.gni b/third_party/yasm/yasm_assemble.gni index 56d7e11a..1a84d51 100644 --- a/third_party/yasm/yasm_assemble.gni +++ b/third_party/yasm/yasm_assemble.gni @@ -42,13 +42,13 @@ # } if (is_mac || is_ios) { - if (cpu_arch == "x86") { + if (current_cpu == "x86") { _yasm_flags = [ "-fmacho32", "-m", "x86", ] - } else if (cpu_arch == "x64") { + } else if (current_cpu == "x64") { _yasm_flags = [ "-fmacho64", "-m", @@ -56,13 +56,13 @@ if (is_mac || is_ios) { ] } } else if (is_posix) { - if (cpu_arch == "x86") { + if (current_cpu == "x86") { _yasm_flags = [ "-felf32", "-m", "x86", ] - } else if (cpu_arch == "x64") { + } else if (current_cpu == "x64") { _yasm_flags = [ "-DPIC", "-felf64", @@ -71,14 +71,14 @@ if (is_mac || is_ios) { ] } } else if (is_win) { - if (cpu_arch == "x86") { + if (current_cpu == "x86") { _yasm_flags = [ "-DPREFIX", "-fwin32", "-m", "x86", ] - } else if (cpu_arch == "x64") { + } else if (current_cpu == "x64") { _yasm_flags = [ "-fwin64", "-m", @@ -99,7 +99,7 @@ template("yasm_assemble") { # Only depend on YASM on x86 systems. Force compilation of .asm files for # ARM to fail. - assert(cpu_arch == "x86" || cpu_arch == "x64") + assert(current_cpu == "x86" || current_cpu == "x64") action_name = "${target_name}_action" source_set_name = target_name diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn index e49b5e9..1cea9ac 100644 --- a/third_party/zlib/BUILD.gn +++ b/third_party/zlib/BUILD.gn @@ -7,7 +7,7 @@ config("zlib_config") { } static_library("zlib_x86_simd") { - if (!is_ios && (cpu_arch == "x86" || cpu_arch == "x64")) { + if (!is_ios && (current_cpu == "x86" || current_cpu == "x64")) { sources = [ "crc_folding.c", "fill_window_sse.c", @@ -65,7 +65,7 @@ static_library("zlib") { "zutil.h", ] - if (!is_ios && (cpu_arch == "x86" || cpu_arch == "x64")) { + if (!is_ios && (current_cpu == "x86" || current_cpu == "x64")) { sources += [ "x86.c" ] } |