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 if (current_cpu == "mipsel") { 44 ohos_app_abi = "mips" 45} else if (current_cpu == "riscv64") { 46 ohos_app_abi = "riscv64" 47} else if (current_cpu == "loongarch64") { 48 ohos_app_abi = "loongarch64" 49} else { 50 assert(false, "Unknown ABI: " + current_cpu) 51} 52 53if (target_cpu == "arm64" || target_cpu == "x86_64" || 54 target_cpu == "loongarch64" || target_cpu == "riscv64") { 55 ohos_64bit_target_cpu = true 56} else if (target_cpu == "arm" || target_cpu == "x86" || 57 target_cpu == "mipsel") { 58 ohos_64bit_target_cpu = false 59} else { 60 assert(false, "Unknown target CPU: $target_cpu") 61} 62 63# Intentionally do not define ohos_app_secondary_abi_cpu and 64# ohos_app_secondary_abi for 32-bit target_cpu, since they are not used. 65if (target_cpu == "arm64") { 66 ohos_secondary_abi_cpu = "arm" 67 ohos_app_secondary_abi = "armeabi-v7a" 68} else if (target_cpu == "x64") { 69 ohos_secondary_abi_cpu = "x86" 70 ohos_app_secondary_abi = "x86" 71} else if (target_cpu == "mipsel") { 72 ohos_secondary_abi_cpu = "mips" 73 ohos_app_secondary_abi = "mips" 74} else if (target_cpu == "riscv64") { 75 ohos_secondary_abi_cpu = "riscv64" 76 ohos_app_secondary_abi = "riscv64" 77} 78 79if (defined(ohos_secondary_abi_cpu)) { 80 ohos_secondary_abi_toolchain = 81 "//build/toolchain/ohos:ohos_clang_${ohos_secondary_abi_cpu}" 82} 83