# Copyright (c) 2022 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("//test/xts/device_attest/build/devattestconfig.gni") import("attestsource.gni") sources_common = sources_notmock sources_common += sources_mock if (enable_attest_debug_memory_leak) { sources_common += [ "utils/attest_utils_memleak.c" ] } if (enable_attest_debug_dfx) { sources_common += [ "dfx/attest_dfx.c" ] } config("devattest_core_config") { visibility = [ ":*" ] cflags = [ "-Wall" ] include_dirs = include_core_dirs if (enable_attest_common_debug) { defines = [ "ATTEST_HILOG_LEVEL = 0" ] } else { defines = [ "ATTEST_HILOG_LEVEL = 1" ] } if (enable_attest_test_mock_network) { defines += [ "__ATTEST_MOCK_NETWORK_STUB__" ] } if (enable_attest_test_mock_device) { defines += [ "__ATTEST_MOCK_DEVICE_STUB__" ] } if (enable_attest_debug_memory_leak) { defines += [ "__ATTEST_DEBUG_MEMORY_LEAK__" ] } if (enable_attest_network_debug_log) { defines += [ "__ATTEST_NETWORK_DEBUG_LOG__" ] } defines += [ "MBEDTLS_ALLOW_PRIVATE_ACCESS" ] defines += [ "OPENSSL_SUPPRESS_DEPRECATED" ] } ohos_prebuilt_etc("network_config.json") { source = "network_config.json" relative_install_dir = "device_attest" subsystem_name = "xts" part_name = "device_attest" } ohos_shared_library("devattest_core") { version_script = "libdevattest_core.map" sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" sources = sources_common configs = [ ":devattest_core_config" ] deps = core_deps deps += [ ":network_config.json" ] external_deps = core_external_deps subsystem_name = "xts" part_name = "device_attest" }