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 22if (!ark_standalone_build) { 23 build_root = "//build" 24 ark_third_party_root = "//third_party" 25 import("$build_root/config/components/toolchain/build_type.gni") 26 import("$build_root/ohos.gni") 27} else { 28 ark_third_party_root = "//arkcompiler/toolchain/build/third_party_gn" 29 import("$build_root/ark.gni") 30 import("$build_root/config/build_type.gni") 31} 32ark_root = "//arkcompiler/runtime_core" 33js_root = "//arkcompiler/ets_runtime" 34global_root = "//base/global/i18n" 35hilog_root = "//base/hiviewdfx/hilog/interfaces/native/innerkits" 36qos_root = "//foundation/resourceschedule/qos_manager" 37compile_llvm_online = false 38 39enable_leak_check = false 40enable_cow_array = true 41enable_coverage = false 42enable_asm_assert = false 43ark_compile_mode = "debug" 44if (defined(is_arkui_x) && is_arkui_x && defined(runtime_mode) && 45 runtime_mode == "release") { 46 ark_compile_mode = "release" 47} 48 49asan_lib_path = "/usr/lib/llvm-10/lib/clang/10.0.0/lib/linux" 50 51# under /system/lib64 dir 52arkcompiler_relative_lib_path = "module/arkcompiler" 53if (is_standard_system || ark_standalone_build) { 54 icu_part_name = "icu" 55 icu_subsystem_name = "thirdparty" 56} else { 57 icu_part_name = "i18n" 58 icu_subsystem_name = "global" 59} 60 61if (defined(is_arkui_x) && is_arkui_x && target_os == "ios") { 62 sdk_libc_secshared_dep = "bounds_checking_function:libsec_static" 63} else { 64 sdk_libc_secshared_dep = "bounds_checking_function:libsec_shared" 65} 66 67# ohos device, windows previewer, mac previewer 68enable_hilog = !ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) && 69 (is_ohos || is_mingw || is_mac) 70enable_dump_in_faultlog = 71 !ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) && is_ohos && 72 is_standard_system 73enable_bytrace = 74 !ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) && is_ohos && 75 is_standard_system 76enable_hitrace = 77 !ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) && is_ohos && 78 is_standard_system 79 80hiviewdfx_deps = [] 81hiviewdfx_ext_deps = [] 82if (enable_dump_in_faultlog) { 83 hiviewdfx_ext_deps += [ 84 "faultloggerd:libfaultloggerd", 85 "init:libbegetutil", 86 ] 87} 88if (enable_bytrace) { 89 hiviewdfx_ext_deps += [ "hitrace:hitrace_meter" ] 90} 91if (enable_hitrace) { 92 hiviewdfx_ext_deps += [ "hitrace:libhitracechain" ] 93} 94if (enable_hilog) { 95 hiviewdfx_ext_deps += [ "hilog:libhilog" ] 96} 97 98enable_target_compilation = 99 !ark_standalone_build && !is_mac && !(defined(is_arkui_x) && is_arkui_x) && 100 current_cpu == "arm64" 101 102have_local_code_sign = false 103if (defined(global_parts_info) && 104 defined(global_parts_info.security_code_signature) && 105 global_parts_info.security_code_signature) { 106 have_local_code_sign = true 107} 108enable_local_code_sign = false 109if (have_local_code_sign && enable_target_compilation) { 110 enable_local_code_sign = true 111} 112