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