1# Copyright (c) 2022 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14if (!defined(ark_standalone_build)) { 15 ark_standalone_build = false 16} 17 18if (target_cpu == "arm64") { 19 TARGET = "aarch64" 20} 21 22declare_args() { 23 toolchain_enable_cmc_gc = false 24} 25 26if (defined(enable_cmc_gc)) { 27 toolchain_enable_cmc_gc = enable_cmc_gc 28} 29 30if (!ark_standalone_build) { 31 build_root = "//build" 32 ark_third_party_root = "//third_party" 33 import("$build_root/config/components/toolchain/build_type.gni") 34 import("$build_root/ohos.gni") 35} else { 36 ark_third_party_root = "//build/third_party_gn" 37 import("$build_root/ark.gni") 38 import("$build_root/config/build_type.gni") 39} 40ark_root = "//arkcompiler/runtime_core" 41js_root = "//arkcompiler/ets_runtime" 42global_root = "//base/global/i18n" 43hilog_root = "//base/hiviewdfx/hilog/interfaces/native/innerkits" 44qos_root = "//foundation/resourceschedule/qos_manager" 45compile_llvm_online = false 46 47enable_leak_check = false 48enable_cow_array = true 49enable_coverage = false 50enable_asm_assert = false 51ark_compile_mode = "debug" 52if (defined(is_arkui_x) && is_arkui_x && defined(runtime_mode) && 53 runtime_mode == "release") { 54 ark_compile_mode = "release" 55} 56 57asan_lib_path = "/usr/lib/llvm-10/lib/clang/10.0.0/lib/linux" 58 59# under /system/lib64 dir 60arkcompiler_relative_lib_path = "module/arkcompiler" 61if (is_standard_system || ark_standalone_build) { 62 icu_part_name = "icu" 63 icu_subsystem_name = "thirdparty" 64} else { 65 icu_part_name = "i18n" 66 icu_subsystem_name = "global" 67} 68 69if (defined(is_arkui_x) && is_arkui_x && target_os == "ios") { 70 sdk_libc_secshared_dep = "bounds_checking_function:libsec_static" 71} else { 72 sdk_libc_secshared_dep = "bounds_checking_function:libsec_shared" 73} 74 75# ohos device, windows previewer, mac previewer 76enable_hilog = !ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) && 77 (is_ohos || is_mingw || is_mac) 78enable_dump_in_faultlog = 79 !ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) && is_ohos && 80 is_standard_system 81enable_bytrace = 82 !ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) && is_ohos && 83 is_standard_system 84enable_hitrace = 85 !ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) && is_ohos && 86 is_standard_system 87 88hiviewdfx_deps = [] 89hiviewdfx_ext_deps = [] 90if (enable_dump_in_faultlog) { 91 hiviewdfx_ext_deps += [ 92 "faultloggerd:libfaultloggerd", 93 "init:libbegetutil", 94 ] 95} 96if (enable_bytrace) { 97 hiviewdfx_ext_deps += [ "hitrace:hitrace_meter" ] 98} 99if (enable_hitrace) { 100 hiviewdfx_ext_deps += [ "hitrace:libhitracechain" ] 101} 102if (enable_hilog) { 103 hiviewdfx_ext_deps += [ "hilog:libhilog" ] 104} 105 106enable_target_compilation = 107 !ark_standalone_build && !is_mac && !(defined(is_arkui_x) && is_arkui_x) && 108 current_cpu == "arm64" 109 110have_local_code_sign = false 111if (defined(global_parts_info) && 112 defined(global_parts_info.security_code_signature) && 113 global_parts_info.security_code_signature) { 114 have_local_code_sign = true 115} 116enable_local_code_sign = false 117if (have_local_code_sign && enable_target_compilation) { 118 enable_local_code_sign = true 119} 120sdk_libc_secshared_ext_dep = "bounds_checking_function:libsec_static" 121