Chromium Code Reviews| 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 assert(rebase_path("//", root_build_dir) == "../../", | 8 assert(rebase_path("//", root_build_dir) == "../../", |
| 9 "Android output directory must be nested 2 levels within src/ (" + | 9 "Android output directory must be nested 2 levels within src/ (" + |
| 10 "e.g.: out-gn/Debug). http://crbug.com/412935") | 10 "e.g.: out-gn/Debug). http://crbug.com/412935") |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 android_objcopy = "${android_tool_prefix}objcopy" | 259 android_objcopy = "${android_tool_prefix}objcopy" |
| 260 android_gdbserver = | 260 android_gdbserver = |
| 261 "$android_ndk_root/prebuilt/$android_prebuilt_arch/gdbserver/gdbserver" | 261 "$android_ndk_root/prebuilt/$android_prebuilt_arch/gdbserver/gdbserver" |
| 262 | 262 |
| 263 # Toolchain stuff ------------------------------------------------------------ | 263 # Toolchain stuff ------------------------------------------------------------ |
| 264 | 264 |
| 265 android_libcpp_root = "$android_ndk_root/sources/cxx-stl/llvm-libc++" | 265 android_libcpp_root = "$android_ndk_root/sources/cxx-stl/llvm-libc++" |
| 266 | 266 |
| 267 # ABI ------------------------------------------------------------------------ | 267 # ABI ------------------------------------------------------------------------ |
| 268 | 268 |
| 269 # Intentionally do not define android_app_secondary_abi for 64-bit | 269 # Intentionally do not define android_app_secondary_abi for 32-bit |
| 270 # android_app_abi, since they are not used. | 270 # android_app_abi, since they are not used. |
| 271 if (current_cpu == "x86") { | 271 if (current_cpu == "x86") { |
| 272 android_app_abi = "x86" | 272 android_app_abi = "x86" |
| 273 android_app_secondary_abi = "x86_64" | |
| 274 } else if (current_cpu == "arm") { | 273 } else if (current_cpu == "arm") { |
| 275 import("//build/config/arm.gni") | 274 import("//build/config/arm.gni") |
| 276 if (arm_version < 7) { | 275 if (arm_version < 7) { |
| 277 android_app_abi = "armeabi" | 276 android_app_abi = "armeabi" |
| 278 } else { | 277 } else { |
| 279 android_app_abi = "armeabi-v7a" | 278 android_app_abi = "armeabi-v7a" |
| 280 } | 279 } |
| 281 android_app_secondary_abi = "arm64-v8a" | |
| 282 } else if (current_cpu == "mipsel") { | 280 } else if (current_cpu == "mipsel") { |
| 283 android_app_abi = "mips" | 281 android_app_abi = "mips" |
| 284 android_app_secondary_abi = "mips64" | |
| 285 } else if (current_cpu == "x64") { | 282 } else if (current_cpu == "x64") { |
| 286 android_app_abi = "x86_64" | 283 android_app_abi = "x86_64" |
| 284 android_app_secondary_abi = "x86" | |
| 287 } else if (current_cpu == "arm64") { | 285 } else if (current_cpu == "arm64") { |
| 288 android_app_abi = "arm64-v8a" | 286 android_app_abi = "arm64-v8a" |
| 287 android_app_secondary_abi = "armeabi-v7a" | |
| 289 } else if (current_cpu == "mips64el") { | 288 } else if (current_cpu == "mips64el") { |
| 290 android_app_abi = "mips64" | 289 android_app_abi = "mips64" |
| 290 android_app_secondary_abi = "mips" | |
| 291 } else { | 291 } else { |
| 292 assert(false, "Unknown Android ABI: " + current_cpu) | 292 assert(false, "Unknown Android ABI: " + current_cpu) |
| 293 } | 293 } |
| 294 | 294 |
| 295 if (android_libcpp_lib_dir == "") { | 295 if (android_libcpp_lib_dir == "") { |
| 296 android_libcpp_lib_dir = "${android_libcpp_root}/libs/${android_app_abi}" | 296 android_libcpp_lib_dir = "${android_libcpp_root}/libs/${android_app_abi}" |
| 297 } | 297 } |
| 298 | |
| 299 # Secondary ABI ------------------------------------------------------------- | |
| 300 if (target_cpu == "arm64" || target_cpu == "x64" || target_cpu == "mips64el") { | |
| 301 android_64bit_target_cpu = true | |
| 302 } else if (target_cpu == "arm" || target_cpu == "x86" || | |
| 303 target_cpu == "mipsel") { | |
| 304 android_64bit_target_cpu = false | |
| 305 } else { | |
| 306 assert(false, "Unknown target CPU: $target_cpu") | |
| 307 } | |
| 308 | |
| 309 # Intentionally do not define android_app_secondary_abi_cpu for 32-bit | |
| 310 # target_cpu, since they are not used. | |
| 311 if (target_cpu == "arm64") { | |
| 312 android_secondary_abi_cpu = "arm" | |
|
agrieve
2016/07/21 16:57:46
nit: can you add a comments saying why these are k
michaelbai
2016/07/21 19:21:08
I thought twice, it is actually better to move the
| |
| 313 } else if (target_cpu == "x64") { | |
| 314 android_secondary_abi_cpu = "x86" | |
| 315 } else if (target_cpu == "mips64el") { | |
| 316 android_secondary_abi_cpu = "mipsel" | |
| 317 } | |
| 318 | |
| 319 if (defined(android_secondary_abi_cpu)) { | |
| 320 _android_secondary_abi_cpu_with_v8 = | |
| 321 "${android_secondary_abi_cpu}_v8_${android_secondary_abi_cpu}" | |
| 322 if (is_clang) { | |
| 323 android_secondary_abi_toolchain = "//build/toolchain/android:clang_${_andr oid_secondary_abi_cpu_with_v8}" | |
| 324 } else { | |
| 325 android_secondary_abi_toolchain = | |
| 326 "//build/toolchain/android:${_android_secondary_abi_cpu_with_v8}" | |
| 327 } | |
| 328 } | |
| 298 } | 329 } |
| OLD | NEW |