1# Copyright (c) 2023 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("//build/ohos.gni") 15import("../../app_domain_verify.gni") 16 17config("app_domain_verify_extension_config") { 18 defines = [] 19 if (target_cpu == "arm64") { 20 defines += [ "APP_USE_ARM64" ] 21 } else if (target_cpu == "arm") { 22 defines += [ "APP_USE_ARM" ] 23 } else if (target_cpu == "x86_64") { 24 defines += [ "APP_USE_X86_64" ] 25 } 26 cflags = [ 27 "-fdata-sections", 28 "-ffunction-sections", 29 "-fstack-protector-strong", 30 "-D_FORTIFY_SOURCE=2", 31 "-Os", 32 ] 33 34 cflags_cc = [ 35 "-fstack-protector-strong", 36 "-Os", 37 ] 38} 39 40config("app_domain_verify_extension_public_config") { 41 visibility = [ ":*" ] 42 include_dirs = [ 43 "include", 44 "${app_domain_verify_common_path}/include", 45 "${app_domain_verify_common_path}/include/zidl", 46 "${app_domain_verify_frameworks_common_path}/include/dfx", 47 ] 48} 49 50ohos_shared_library("app_domain_verify_extension_framework") { 51 branch_protector_ret = "pac_ret" 52 sources = [ 53 "src/app_domain_verify_agent_ext.cpp", 54 "src/app_domain_verify_extension_mgr.cpp", 55 "src/app_domain_verify_extension_register.cpp", 56 ] 57 configs = [ ":app_domain_verify_extension_config" ] 58 public_configs = [ ":app_domain_verify_extension_public_config" ] 59 deps = [ "${app_domain_verify_common_path}:app_domain_verify_common" ] 60 version_script = "extension.versionscript" 61 external_deps = [ 62 "ability_base:want", 63 "c_utils:utils", 64 "hilog:libhilog", 65 "hisysevent:libhisysevent", 66 "ipc:ipc_single", 67 "samgr:samgr_proxy", 68 ] 69 defines = [] 70 if (build_variant == "user") { 71 defines += [ "IS_RELEASE_VERSION" ] 72 } 73 sanitize = { 74 boundary_sanitize = true 75 cfi = true 76 cfi_cross_dso = true 77 debug = false 78 integer_overflow = true 79 ubsan = true 80 } 81 subsystem_name = "bundlemanager" 82 part_name = "app_domain_verify" 83} 84