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("//foundation/bundlemanager/app_domain_verify/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 = [ "-Os" ] 35} 36 37config("app_domain_verify_extension_public_config") { 38 visibility = [ ":*" ] 39 include_dirs = [ 40 "include", 41 "${app_domain_verify_common_path}/include", 42 "${app_domain_verify_common_path}/include/zidl", 43 "${app_domain_verify_frameworks_common_path}/include/dfx", 44 ] 45} 46 47ohos_shared_library("app_domain_verify_extension_framework") { 48 branch_protector_ret = "pac_ret" 49 sources = [ 50 "src/app_domain_verify_agent_ext.cpp", 51 "src/app_domain_verify_extension_mgr.cpp", 52 "src/app_domain_verify_extension_register.cpp", 53 ] 54 configs = [ ":app_domain_verify_extension_config" ] 55 public_configs = [ ":app_domain_verify_extension_public_config" ] 56 deps = [ "${app_domain_verify_common_path}:app_domain_verify_common" ] 57 version_script = "extension.versionscript" 58 external_deps = [ 59 "ability_base:want", 60 "c_utils:utils", 61 "hilog:libhilog", 62 "hisysevent:libhisysevent", 63 "ipc:ipc_single", 64 "samgr:samgr_proxy", 65 ] 66 defines = [] 67 if (build_variant == "user") { 68 defines += [ "IS_RELEASE_VERSION" ] 69 } 70 sanitize = { 71 cfi = true 72 cfi_cross_dso = true 73 debug = false 74 } 75 subsystem_name = "bundlemanager" 76 part_name = "app_domain_verify" 77} 78