OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # This file contains common system config stuff for the Android build. | 5 # This file contains common system config stuff for the Android build. |
6 | 6 |
7 if (is_android) { | 7 if (is_android) { |
8 declare_args() { | 8 declare_args() { |
9 # Absolute directory containing the Android source code. | 9 # Absolute directory containing the Android source code. |
10 android_src = "" | 10 android_src = "" |
11 | 11 |
12 # This is set when building the Android WebView inside the Android build | 12 # This is set when building the Android WebView inside the Android build |
13 # system, using the 'android' gyp backend. The WebView code is still built | 13 # system, using the 'android' gyp backend. The WebView code is still built |
14 # when this is unset, but builds using the normal chromium build system. | 14 # when this is unset, but builds using the normal chromium build system. |
15 is_android_webview_build = false | 15 is_android_webview_build = false |
16 } | 16 } |
17 | 17 |
18 if (is_android_webview_build) { | 18 if (is_android_webview_build) { |
19 assert(android_src != "", | 19 assert(android_src != "", |
20 "You must specify android_src for an Android WebView build.") | 20 "You must specify android_src for an Android WebView build.") |
21 } | 21 } |
22 | 22 |
23 # android_ndk_root ----------------------------------------------------------- | 23 # Host stuff ----------------------------------------------------------------- |
24 | 24 |
25 # Full system path to the Android NDK. | 25 # Defines the name the Android build gives to the current host CPU |
26 android_ndk_root = rebase_path("//third_party/android_tools/ndk") | 26 # architecture, which is different than the names GN uses. |
| 27 if (build_cpu_arch == "x64") { |
| 28 android_host_arch = "x86_64" |
| 29 } else if (build_cpu_arch == "x86") { |
| 30 android_host_arch = "x86" |
| 31 } else { |
| 32 assert(false, "Need Android toolchain support for your build CPU arch.") |
| 33 } |
| 34 |
| 35 # Defines the name the Android build gives to the current host CPU |
| 36 # architecture, which is different than the names GN uses. |
| 37 if (build_os == "linux") { |
| 38 android_host_os = "linux" |
| 39 } else { |
| 40 assert(false, "Need Android toolchain support for your build OS.") |
| 41 } |
| 42 |
| 43 # Directories and files ------------------------------------------------------ |
| 44 # |
| 45 # We define may of the dirs strings here for each output architecture (rather |
| 46 # than just the current one) since these are needed by the Android toolchain |
| 47 # file to define toolchains for all possible targets in one pass. |
| 48 |
| 49 # Path to the Android NDK. |
| 50 android_ndk_root = "//third_party/android_tools/ndk" |
| 51 |
| 52 # Subdirectories inside android_ndk_root that contain the sysroot for the |
| 53 # associated platform. |
| 54 x86_android_sysroot_subdir = "platforms/android-14/arch-x86" |
| 55 arm_android_sysroot_subdir = "platforms/android-14/arch-arm" |
| 56 mips_android_sysroot_subdir = "platforms/android-14/arch-mips" |
| 57 |
| 58 # Toolchain root directory for each build. The actual binaries are inside |
| 59 # a "bin" directory inside of these. |
| 60 x86_android_toolchain_root = "$android_ndk_root/toolchains/x86-4.6/prebuilt/$a
ndroid_host_os-$android_host_arch" |
| 61 arm_android_toolchain_root = "$android_ndk_root/toolchains/arm-linux-androidea
bi-4.6/prebuilt/$android_host_os-$android_host_arch" |
| 62 mips_android_toolchain_root = "$android_ndk_root/toolchains/mipsel-linux-andro
id-4.6/prebuilt/$android_host_os-$android_host_arch" |
| 63 |
| 64 # Location of libgcc. This is only needed for the current GN toolchain, so we |
| 65 # only need to define the current one, rather than one for every platform |
| 66 # like the toolchain roots. |
| 67 if (cpu_arch == "x86") { |
| 68 android_libgcc_file = |
| 69 "$x86_android_toolchain_root/lib/gcc/i686-linux-android/4.6/libgcc.a" |
| 70 } else if (cpu_arch == "arm") { |
| 71 android_libgcc_file = |
| 72 "$arm_android_toolchain_root/lib/gcc/arm-linux-androideabi/4.6/libgcc.a" |
| 73 } else if (cpu_arch == "mips") { |
| 74 android_libgcc_file = |
| 75 "$mips_android_toolchain_root/lib/gcc/mipsel-linux-android/4.6/libgcc.a" |
| 76 } else { |
| 77 assert(false, "Need android libgcc support for your target arch.") |
| 78 } |
27 | 79 |
28 # stlport stuff -------------------------------------------------------------- | 80 # stlport stuff -------------------------------------------------------------- |
29 | 81 |
30 use_system_stlport = is_android_webview_build | 82 use_system_stlport = is_android_webview_build |
31 | 83 |
32 if (use_system_stlport) { | 84 if (use_system_stlport) { |
33 android_stlport_library = "stlport" | 85 android_stlport_library = "stlport" |
34 } else if (component_mode == "shared_library") { | 86 } else if (component_mode == "shared_library") { |
35 android_stlport_library = "stlport_shared" | 87 android_stlport_library = "stlport_shared" |
36 } else { | 88 } else { |
(...skipping 15 matching lines...) Expand all Loading... |
52 android_app_abi = "mips" | 104 android_app_abi = "mips" |
53 } else { | 105 } else { |
54 assert(false, "Unknown Android ABI: " + cpu_arch) | 106 assert(false, "Unknown Android ABI: " + cpu_arch) |
55 } | 107 } |
56 } else { | 108 } else { |
57 if (!defined(is_android_webview_build)) { | 109 if (!defined(is_android_webview_build)) { |
58 is_android_webview_build = false | 110 is_android_webview_build = false |
59 } | 111 } |
60 use_system_stlport = false | 112 use_system_stlport = false |
61 } | 113 } |
OLD | NEW |