# Copyright (c) 2023-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("../../../code_signature.gni") config("public_code_sign_utils_configs") { include_dirs = [ "include" ] } ohos_shared_library("libcode_sign_utils") { sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" sources = [ "${code_signature_root_dir}/utils/src/code_sign_block.cpp", "${code_signature_root_dir}/utils/src/file_helper.cpp", "src/code_sign_enable_multi_task.cpp", "src/code_sign_helper.cpp", "src/code_sign_utils.cpp", "src/code_sign_utils_in_c.cpp", "src/stat_utils.cpp", ] public_configs = [ "${code_signature_root_dir}:common_public_config", "${code_signature_root_dir}/services/key_enable:key_enable_rust_interface_config", ":public_code_sign_utils_configs", ] configs = [ "${code_signature_root_dir}:common_utils_config" ] deps = [ "${code_signature_root_dir}/utils:fsverity_sign_src_set" ] if (host_os == "linux" && !is_asan && !ohos_indep_compiler_enable && !use_clang_coverage) { deps += [ "${code_signature_root_dir}/services/key_enable:key_enable_lib" ] } else { sources += [ "${code_signature_root_dir}/services/key_enable/src/asan/disable_rust_interface.cpp" ] } defines = [] if (code_signature_support_oh_code_sign) { defines += [ "SUPPORT_OH_CODE_SIGN" ] } if (build_variant == "root" || code_signature_enable_xpm_mode == 0) { defines += [ "SUPPORT_PERMISSIVE_MODE" ] } external_deps = [ "ability_base:extractortool", "appverify:libhapverify", "c_utils:utils", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "openssl:libcrypto_shared", ] install_enable = true part_name = "code_signature" subsystem_name = "security" install_images = [ "system" ] }