1# Copyright (c) 2023-2024 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 14import("//arkcompiler/runtime_core/arkplatform/arkplatform_config.gni") 15 16group("arkplatform_packages") { 17 deps = [ ":libarkplatform" ] 18} 19 20config("arkplatform_public_config") { 21 include_dirs = [ "$arkplatform_root" ] 22} 23 24config("arkplatform_private_config") { 25 cflags_c = [] 26 cflags_cc = [ 27 "-Wall", 28 "-Werror", 29 "-Wextra", 30 "-pedantic", 31 "-Wno-invalid-offsetof", 32 "-Wno-gnu-statement-expression", 33 "-fno-rtti", 34 "-std=c++17", 35 ] 36 defines = [] 37 38 if (is_fastverify) { 39 cflags_cc += [ 40 "-O3", 41 "-ggdb3", 42 "-gdwarf-4", 43 "-fno-omit-frame-pointer", 44 "-D_GLIBCXX_ASSERTIONS", 45 ] 46 cflags_c += [ 47 "-O3", 48 "-ggdb3", 49 "-gdwarf-4", 50 "-fno-omit-frame-pointer", 51 "-D_GLIBCXX_ASSERTIONS", 52 ] 53 } else if (is_debug) { 54 cflags_cc += [ 55 "-Og", 56 "-ggdb3", 57 "-gdwarf-4", 58 ] 59 } else { 60 defines += [ "NDEBUG" ] 61 } 62 63 if (is_asan) { 64 cflags_cc += [ "-g" ] 65 defines += [ "__SANITIZE_ADDRESS__" ] 66 } 67 68 if (current_cpu == "arm") { 69 cflags_cc += [ 70 "-march=armv7-a", 71 "-marm", 72 "-mfpu=vfp", 73 ] 74 } 75} 76 77ohos_static_library("arkplatform_static") { 78 configs = [ 79 ":arkplatform_private_config", 80 ":arkplatform_public_config", 81 ] 82 include_dirs = [ "$arkplatform_root" ] 83 sources = [ "hybrid/xgc/xgc.cpp" ] 84 85 part_name = "runtime_core" 86 subsystem_name = "arkcompiler" 87} 88 89ohos_shared_library("libarkplatform") { 90 deps = [ ":arkplatform_static" ] 91 if (!is_mingw && !is_mac) { 92 output_extension = "so" 93 } 94 innerapi_tags = [ "platformsdk_indirect" ] 95 part_name = "runtime_core" 96 subsystem_name = "arkcompiler" 97} 98 99ohos_static_library("arkplatform_header") { 100 public_configs = [ ":arkplatform_public_config" ] 101 102 part_name = "runtime_core" 103 subsystem_name = "arkcompiler" 104}