skia2/gn/BUILDCONFIG.gn
mtklein 2b3c2a3ff9 GN: add sanitize arg
Attempt to take over all *SAN builds.

MSAN has a lot of coordination required between gn/BUILD.gn and gn_flavor.py.
I'd like to follow up to move more of this into gn/BUILD.gn, to make it easier
to use locally.

The compile steps should be much faster now.  We no longer build CMake
and Clang for every run, instead using the clang_linux CIPD package.  This
removes the need for all the third_party/externals/llvm/... dependencies.

Similarly, since we're using the clang_linux package, we no longer depend
on Chrome's Clang, and thus no longer need to sync chromium on these bots.

Instead of packaging up MSAN libraries and llvm-symbolizer in the compile
output, I have the test / perf bots also depend on the clang_linux package.
These do not vary from build to build.

No more need for the xsan.blacklist -include hack: Clang, GN, and Ninja
all track changes to xsan.blacklist without our help.

This has the incidental effect of upgrading the compiler used by *SAN
bots from Clang 3.8 to Clang 3.9.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2289343002

Review-Url: https://codereview.chromium.org/2289343002
2016-09-08 08:39:34 -07:00

135 lines
3.0 KiB
Plaintext

# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# It's best to keep the names and defaults of is_foo flags consistent with Chrome.
declare_args() {
is_debug = true
is_component_build = false
ndk = ""
sanitize = ""
}
# Platform detection
if (target_os == "") {
target_os = host_os
if (ndk != "") {
target_os = "android"
}
}
if (current_os == "") {
current_os = target_os
}
is_android = current_os == "android"
is_fuchsia = current_os == "fuchsia"
is_ios = current_os == "ios"
is_linux = current_os == "linux"
is_mac = current_os == "mac"
is_win = current_os == "win"
if (target_cpu == "") {
target_cpu = host_cpu
if (is_android) {
target_cpu = "arm64"
}
}
if (current_cpu == "") {
current_cpu = target_cpu
}
if (is_android) {
ndk_host = ""
ndk_target = ""
ndk_platform = ""
ndk_stdlib = ""
nkd_gccdir = ""
if (host_os == "linux") {
ndk_host = "linux-x86_64"
} else if (host_os == "mac") {
ndk_host = "darwin-x86_64"
}
if (target_cpu == "arm64") {
ndk_target = "aarch64-linux-android"
ndk_platform = "android-21/arch-arm64"
ndk_stdlib = "arm64-v8a"
ndk_gccdir = ndk_target
} else if (target_cpu == "arm") {
ndk_target = "arm-linux-androideabi"
ndk_platform = "android-18/arch-arm"
ndk_stdlib = "armeabi-v7a"
ndk_gccdir = ndk_target
} else if (target_cpu == "mips64el") {
ndk_target = "mips64el-linux-android"
ndk_platform = "android-21/arch-mips64"
ndk_stdlib = "mips64"
ndk_gccdir = ndk_target
} else if (target_cpu == "mipsel") {
ndk_target = "mipsel-linux-android"
ndk_platform = "android-18/arch-mips"
ndk_stdlib = "mips"
ndk_gccdir = ndk_target
} else if (target_cpu == "x64") {
ndk_target = "x86_64-linux-android"
ndk_platform = "android-21/arch-x86_64"
ndk_stdlib = "x86_64"
ndk_gccdir = ndk_stdlib
} else if (target_cpu == "x86") {
ndk_target = "i686-linux-android"
ndk_platform = "android-18/arch-x86"
ndk_stdlib = "x86"
ndk_gccdir = ndk_stdlib
}
}
# A component is either a static or a shared library.
template("component") {
_component_mode = "static_library"
if (is_component_build) {
_component_mode = "shared_library"
}
target(_component_mode, target_name) {
forward_variables_from(invoker, "*")
}
}
# Default configs
default_configs = [
"//gn:default",
"//gn:no_rtti",
]
if (!is_debug) {
default_configs += [ "//gn:release" ]
}
set_defaults("executable") {
configs = default_configs + [ "//gn:executable" ]
}
set_defaults("source_set") {
configs = default_configs
}
set_defaults("static_library") {
configs = default_configs
}
set_defaults("shared_library") {
configs = default_configs
}
set_defaults("component") {
configs = default_configs
if (!is_component_build) {
complete_static_lib = true
}
}
# For now, we support GCC-like toolchains, including Clang.
set_default_toolchain("//gn:gcc_like")