# Copyright (c) 2023 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") { 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/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", "${openssl_dir}:libcrypto_shared", ] if (host_os == "linux" && !is_asan) { 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) { defines += [ "SUPPORT_PERMISSIVE_MODE" ] } external_deps = [ "ability_base:extractortool", "appverify:libhapverify", "c_utils:utils", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", ] install_enable = true part_name = "code_signature" subsystem_name = "security" install_images = [ "system" ] }