2016-07-21 19:25:45 +00:00
|
|
|
# Copyright 2016 Google Inc.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
2016-09-21 16:14:19 +00:00
|
|
|
is_skia_standalone = true
|
|
|
|
|
2016-07-21 19:25:45 +00:00
|
|
|
# It's best to keep the names and defaults of is_foo flags consistent with Chrome.
|
|
|
|
|
|
|
|
declare_args() {
|
2016-09-14 18:16:49 +00:00
|
|
|
is_official_build = false
|
2016-07-21 19:25:45 +00:00
|
|
|
is_component_build = false
|
2016-08-25 21:50:44 +00:00
|
|
|
ndk = ""
|
Update to Android NDK r13.
The libc++ include paths have changed very slightly. I've left GN compatible with both older r12 NDKs and the new r13 to smooth the transition.
The libc++ in r13 depends on long-double math.h functions (cosl, atanl, etc.) only available in Android API v21 (Lollipop) and up. That's what the 64-bit bots were already on, so we just pull the 32-bit bots up to the same target. Conveniently, the oldest bots we have (N7 and N10) are on Lollipop.
The r13 MIPS64 sysroots are a little weird... /usr/include and /usr/lib64 but no /usr/lib. That'd be fine---we only want 64-bit builds---but Clang searches for /usr/lib64 via its path to /usr/lib, and without at least an empty /usr/lib, it can't find /usr/lib64. So you'll see a special mips64el section in the GN config where we do this all manually (other platforms pick this all up correctly from --sysroot). I've chosen to do this rather than fix it up in the asset create.py scripts so that we stay compatible with vanilla NDKs, which is convenient for developers.
CQ_INCLUDE_TRYBOTS=master.client.skia.compile:Build-Mac-Clang-arm64-Debug-GN_Android-Trybot,Build-Ubuntu-Clang-arm-Debug-GN_Android-Trybot,Build-Ubuntu-Clang-arm-Release-GN_Android-Trybot,Build-Ubuntu-Clang-arm64-Debug-GN_Android-Trybot,Build-Ubuntu-Clang-arm64-Debug-GN_Android_FrameworkDefs-Trybot,Build-Ubuntu-Clang-arm64-Debug-GN_Android_Vulkan-Trybot,Build-Ubuntu-Clang-arm64-Release-GN_Android-Trybot,Build-Ubuntu-Clang-mips64el-Debug-GN_Android-Trybot,Build-Ubuntu-Clang-mips64el-Release-GN_Android-Trybot,Build-Ubuntu-Clang-mips64el-Release-GN_Android-Trybot,Build-Ubuntu-Clang-mipsel-Debug-GN_Android-Trybot,Build-Ubuntu-Clang-mipsel-Release-GN_Android-Trybot,Build-Ubuntu-Clang-x64-Debug-GN_Android-Trybot,Build-Ubuntu-Clang-x64-Release-GN_Android-Trybot,Build-Ubuntu-Clang-x86-Debug-GN_Android-Trybot,Build-Ubuntu-Clang-x86-Release-GN_Android-Trybot
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3180
Change-Id: I6f3b5d9411ded0ee49c1099490f41fa86a8736f8
Reviewed-on: https://skia-review.googlesource.com/3180
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-10-11 15:21:36 +00:00
|
|
|
ndk_api = 21
|
2016-09-08 15:39:34 +00:00
|
|
|
sanitize = ""
|
2016-07-21 19:25:45 +00:00
|
|
|
}
|
2016-09-14 18:16:49 +00:00
|
|
|
declare_args() {
|
|
|
|
is_debug = !is_official_build
|
|
|
|
}
|
|
|
|
|
|
|
|
assert(!(is_debug && is_official_build))
|
2016-07-21 19:25:45 +00:00
|
|
|
|
|
|
|
# Platform detection
|
|
|
|
if (target_os == "") {
|
|
|
|
target_os = host_os
|
2016-08-25 21:50:44 +00:00
|
|
|
if (ndk != "") {
|
|
|
|
target_os = "android"
|
|
|
|
}
|
2016-07-21 19:25:45 +00:00
|
|
|
}
|
|
|
|
if (current_os == "") {
|
|
|
|
current_os = target_os
|
|
|
|
}
|
|
|
|
|
2016-08-26 15:13:04 +00:00
|
|
|
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"
|
|
|
|
|
2016-08-17 01:28:43 +00:00
|
|
|
if (target_cpu == "") {
|
|
|
|
target_cpu = host_cpu
|
2016-11-03 18:06:31 +00:00
|
|
|
if (is_android || is_ios) {
|
2016-08-25 21:50:44 +00:00
|
|
|
target_cpu = "arm64"
|
|
|
|
}
|
2016-08-17 01:28:43 +00:00
|
|
|
}
|
|
|
|
if (current_cpu == "") {
|
|
|
|
current_cpu = target_cpu
|
|
|
|
}
|
|
|
|
|
2016-08-25 21:50:44 +00:00
|
|
|
if (is_android) {
|
|
|
|
ndk_host = ""
|
|
|
|
ndk_target = ""
|
|
|
|
ndk_platform = ""
|
|
|
|
ndk_stdlib = ""
|
2016-09-14 13:12:09 +00:00
|
|
|
ndk_gccdir = ""
|
|
|
|
|
2016-08-26 15:13:04 +00:00
|
|
|
if (host_os == "linux") {
|
2016-08-25 21:50:44 +00:00
|
|
|
ndk_host = "linux-x86_64"
|
2016-08-26 15:13:04 +00:00
|
|
|
} else if (host_os == "mac") {
|
|
|
|
ndk_host = "darwin-x86_64"
|
2016-10-24 20:49:15 +00:00
|
|
|
} else if (host_os == "win") {
|
|
|
|
ndk_host = "windows-x86_64"
|
2016-08-25 21:50:44 +00:00
|
|
|
}
|
2016-08-26 15:13:04 +00:00
|
|
|
|
2016-08-25 21:50:44 +00:00
|
|
|
if (target_cpu == "arm64") {
|
|
|
|
ndk_target = "aarch64-linux-android"
|
2016-09-14 13:12:09 +00:00
|
|
|
ndk_platform = "android-${ndk_api}/arch-arm64"
|
2016-08-25 21:50:44 +00:00
|
|
|
ndk_stdlib = "arm64-v8a"
|
2016-08-26 15:13:04 +00:00
|
|
|
ndk_gccdir = ndk_target
|
|
|
|
} else if (target_cpu == "arm") {
|
|
|
|
ndk_target = "arm-linux-androideabi"
|
2016-09-14 13:12:09 +00:00
|
|
|
ndk_platform = "android-${ndk_api}/arch-arm"
|
2016-08-26 15:13:04 +00:00
|
|
|
ndk_stdlib = "armeabi-v7a"
|
|
|
|
ndk_gccdir = ndk_target
|
|
|
|
} else if (target_cpu == "mips64el") {
|
|
|
|
ndk_target = "mips64el-linux-android"
|
2016-09-14 13:12:09 +00:00
|
|
|
ndk_platform = "android-${ndk_api}/arch-mips64"
|
2016-08-26 15:13:04 +00:00
|
|
|
ndk_stdlib = "mips64"
|
|
|
|
ndk_gccdir = ndk_target
|
|
|
|
} else if (target_cpu == "mipsel") {
|
|
|
|
ndk_target = "mipsel-linux-android"
|
2016-09-14 13:12:09 +00:00
|
|
|
ndk_platform = "android-${ndk_api}/arch-mips"
|
2016-08-26 15:13:04 +00:00
|
|
|
ndk_stdlib = "mips"
|
|
|
|
ndk_gccdir = ndk_target
|
|
|
|
} else if (target_cpu == "x64") {
|
|
|
|
ndk_target = "x86_64-linux-android"
|
2016-09-14 13:12:09 +00:00
|
|
|
ndk_platform = "android-${ndk_api}/arch-x86_64"
|
2016-08-26 15:13:04 +00:00
|
|
|
ndk_stdlib = "x86_64"
|
|
|
|
ndk_gccdir = ndk_stdlib
|
|
|
|
} else if (target_cpu == "x86") {
|
|
|
|
ndk_target = "i686-linux-android"
|
2016-09-14 13:12:09 +00:00
|
|
|
ndk_platform = "android-${ndk_api}/arch-x86"
|
2016-08-26 15:13:04 +00:00
|
|
|
ndk_stdlib = "x86"
|
|
|
|
ndk_gccdir = ndk_stdlib
|
2016-08-25 21:50:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-29 16:10:31 +00:00
|
|
|
# A component is either a static or a shared library.
|
2016-07-21 19:25:45 +00:00
|
|
|
template("component") {
|
2016-07-29 16:10:31 +00:00
|
|
|
_component_mode = "static_library"
|
2016-07-21 19:25:45 +00:00
|
|
|
if (is_component_build) {
|
|
|
|
_component_mode = "shared_library"
|
|
|
|
}
|
|
|
|
|
|
|
|
target(_component_mode, target_name) {
|
|
|
|
forward_variables_from(invoker, "*")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Default configs
|
2016-08-03 22:08:04 +00:00
|
|
|
default_configs = [
|
|
|
|
"//gn:default",
|
2016-10-26 15:41:47 +00:00
|
|
|
"//gn:no_exceptions",
|
2016-08-03 22:08:04 +00:00
|
|
|
"//gn:no_rtti",
|
2016-10-13 03:58:06 +00:00
|
|
|
"//gn:warnings",
|
2016-11-16 17:13:44 +00:00
|
|
|
"//gn:warnings_except_public_headers",
|
2016-08-03 22:08:04 +00:00
|
|
|
]
|
2016-07-21 19:25:45 +00:00
|
|
|
if (!is_debug) {
|
2016-08-03 22:08:04 +00:00
|
|
|
default_configs += [ "//gn:release" ]
|
2016-07-21 19:25:45 +00:00
|
|
|
}
|
2016-09-14 18:16:49 +00:00
|
|
|
if (!is_official_build) {
|
|
|
|
default_configs += [ "//gn:debug_symbols" ]
|
|
|
|
}
|
2016-10-04 21:09:13 +00:00
|
|
|
default_configs += [ "//gn:extra_flags" ]
|
2016-07-21 19:25:45 +00:00
|
|
|
|
|
|
|
set_defaults("executable") {
|
2016-10-04 21:09:13 +00:00
|
|
|
configs = [ "//gn:executable" ] + default_configs
|
2016-07-21 19:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
set_defaults("source_set") {
|
2016-08-03 22:08:04 +00:00
|
|
|
configs = default_configs
|
2016-07-21 19:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
set_defaults("static_library") {
|
2016-08-03 22:08:04 +00:00
|
|
|
configs = default_configs
|
2016-07-21 19:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
set_defaults("shared_library") {
|
2016-08-03 22:08:04 +00:00
|
|
|
configs = default_configs
|
2016-07-21 19:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
set_defaults("component") {
|
2016-08-03 22:08:04 +00:00
|
|
|
configs = default_configs
|
2016-08-25 00:32:30 +00:00
|
|
|
if (!is_component_build) {
|
|
|
|
complete_static_lib = true
|
|
|
|
}
|
2016-07-21 19:25:45 +00:00
|
|
|
}
|
|
|
|
|
2016-09-16 20:29:57 +00:00
|
|
|
if (is_win) {
|
|
|
|
# Windows tool chain
|
|
|
|
set_default_toolchain("//gn:msvc")
|
|
|
|
} else {
|
|
|
|
# GCC-like toolchains, including Clang.
|
|
|
|
set_default_toolchain("//gn:gcc_like")
|
|
|
|
}
|