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

Unified Diff: build/config/android/config.gni

Issue 275703003: Make GN Android build link executables (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 | « build/config/BUILDCONFIG.gn ('k') | build/config/compiler/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/config.gni
diff --git a/build/config/android/config.gni b/build/config/android/config.gni
index 6a9080bcf86c93da40ff1b7c30f4370dd876412b..dc0a384273e45d28ca7817a2b0ba7c1929f706e9 100644
--- a/build/config/android/config.gni
+++ b/build/config/android/config.gni
@@ -20,10 +20,64 @@ if (is_android) {
"You must specify android_src for an Android WebView build.")
}
- # android_ndk_root -----------------------------------------------------------
+ # Host stuff -----------------------------------------------------------------
- # Full system path to the Android NDK.
- android_ndk_root = rebase_path("//third_party/android_tools/ndk")
+ # 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") {
+ android_host_arch = "x86_64"
+ } else if (build_cpu_arch == "x86") {
+ android_host_arch = "x86"
+ } else {
+ assert(false, "Need Android toolchain support for your build CPU arch.")
+ }
+
+ # 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") {
+ android_host_os = "linux"
+ } else {
+ assert(false, "Need Android toolchain support for your build OS.")
+ }
+
+ # Directories and files ------------------------------------------------------
+ #
+ # We define may of the dirs strings here for each output architecture (rather
+ # than just the current one) since these are needed by the Android toolchain
+ # file to define toolchains for all possible targets in one pass.
+
+ # Path to the Android NDK.
+ android_ndk_root = "//third_party/android_tools/ndk"
+
+ # Subdirectories inside android_ndk_root that contain the sysroot for the
+ # associated platform.
+ _android_api_level = 14
awong 2014/05/12 21:34:23 nit: could also be _android_api_level_subdir = "
+ x86_android_sysroot_subdir = "platforms/android-${_android_api_level}/arch-x86"
+ arm_android_sysroot_subdir = "platforms/android-${_android_api_level}/arch-arm"
+ mips_android_sysroot_subdir = "platforms/android-${_android_api_level}/arch-mips"
+
+ # Toolchain root directory for each build. The actual binaries are inside
+ # a "bin" directory inside of these.
+ _android_toolchain_version = "4.6"
+ x86_android_toolchain_root = "$android_ndk_root/toolchains/x86-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch}"
+ arm_android_toolchain_root = "$android_ndk_root/toolchains/arm-linux-androideabi-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch}"
+ mips_android_toolchain_root = "$android_ndk_root/toolchains/mipsel-linux-android-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch}"
+
+ # 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") {
+ android_libgcc_file =
+ "$x86_android_toolchain_root/lib/gcc/i686-linux-android/${_android_toolchain_version}/libgcc.a"
+ } else if (cpu_arch == "arm") {
+ android_libgcc_file =
+ "$arm_android_toolchain_root/lib/gcc/arm-linux-androideabi/${_android_toolchain_version}/libgcc.a"
+ } else if (cpu_arch == "mips") {
+ android_libgcc_file =
+ "$mips_android_toolchain_root/lib/gcc/mipsel-linux-android/${_android_toolchain_version}/libgcc.a"
+ } else {
+ assert(false, "Need android libgcc support for your target arch.")
+ }
# stlport stuff --------------------------------------------------------------
« no previous file with comments | « build/config/BUILDCONFIG.gn ('k') | build/config/compiler/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698