1# Copyright 2017 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5# Logic separated out from config.gni so that it can be used by compiler.gni 6# without introducing a circular dependency. 7 8assert(is_ohos) 9 10declare_args() { 11 # Adds instrumentation to each function. Writes a file with the order that 12 # functions are called at startup. 13 use_order_profiling = false 14 15 # Only effective if use_order_profiling = true. When this is true, 16 # instrumentation switches from startup profiling after a delay, and 17 # then waits for a devtools memory dump request to dump all 18 # profiling information. When false, the same delay is used to switch from 19 # startup, and then after a second delay all profiling information is dumped. 20 devtools_instrumentation_dumping = false 21 22 # Builds secondary abi for APPs, supports build 32-bit arch as secondary 23 # abi in 64-bit Monochrome and WebView. 24 build_app_secondary_abi = true 25} 26 27assert(!devtools_instrumentation_dumping || use_order_profiling, 28 "devtools_instrumentation_dumping requires use_order_profiling") 29 30if (current_cpu == "x86") { 31 ohos_app_abi = "x86" 32} else if (current_cpu == "arm") { 33 import("//build/config/arm.gni") 34 if (arm_version < 7) { 35 ohos_app_abi = "armeabi" 36 } else { 37 ohos_app_abi = "armeabi-v7a" 38 } 39} else if (current_cpu == "x86_64") { 40 ohos_app_abi = "x86_64" 41} else if (current_cpu == "arm64") { 42 ohos_app_abi = "arm64-v8a" 43} else { 44 assert(false, "Unknown ABI: " + current_cpu) 45} 46 47if (target_cpu == "arm64" || target_cpu == "x86_64") { 48 ohos_64bit_target_cpu = true 49} else if (target_cpu == "arm" || target_cpu == "x86") { 50 ohos_64bit_target_cpu = false 51} else { 52 assert(false, "Unknown target CPU: $target_cpu") 53} 54 55# Intentionally do not define ohos_app_secondary_abi_cpu and 56# ohos_app_secondary_abi for 32-bit target_cpu, since they are not used. 57if (target_cpu == "arm64") { 58 ohos_secondary_abi_cpu = "arm" 59 ohos_app_secondary_abi = "armeabi-v7a" 60} else if (target_cpu == "x64") { 61 ohos_secondary_abi_cpu = "x86" 62 ohos_app_secondary_abi = "x86" 63} 64 65if (defined(ohos_secondary_abi_cpu)) { 66 ohos_secondary_abi_toolchain = 67 "//build/toolchain/ohos:ohos_clang_${ohos_secondary_abi_cpu}" 68} 69