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