1# Copyright (c) 2021 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("../dsoftbus_dfx.gni") 15 16dsoftbus_root_path = "../../../.." 17 18softbus_anonymizer_src = [ "src/anonymizer.c" ] 19 20if (defined(ohos_lite)) { 21 if (ohos_kernel_type == "liteos_m") { 22 build_type = "static_library" 23 libsec_deps = "//third_party/bounds_checking_function:libsec_static" 24 } else { 25 build_type = "shared_library" 26 libsec_deps = "//third_party/bounds_checking_function:libsec_shared" 27 } 28 config("dsoftbus_anonymizer_interface_lite") { 29 include_dirs = [ 30 "$dsoftbus_dfx_path/interface/include", 31 "$dsoftbus_root_path/interfaces/kits/common", 32 "$hilog_lite_include_path", 33 "$utils_lite_include_path", 34 ] 35 cflags = ohos_lite_cflags 36 cflags_cc = ohos_lite_cflags 37 } 38 39 target(build_type, "softbus_dfx_anonymizer") { 40 include_dirs = [ 41 "$dsoftbus_dfx_path/interface/include", 42 "$dsoftbus_root_path/interfaces/kits/common", 43 ] 44 sources = softbus_anonymizer_src 45 deps = [ 46 "$hilog_lite_deps_path", 47 "$libsec_deps", 48 ] 49 public_configs = [ ":dsoftbus_anonymizer_interface_lite" ] 50 } 51} else { 52 config("dsoftbus_anonymizer_interface_std") { 53 include_dirs = [ 54 "$dsoftbus_dfx_path/interface/include", 55 "$dsoftbus_root_path/interfaces/kits/common", 56 ] 57 } 58 ohos_shared_library("softbus_dfx_anonymizer") { 59 sanitize = { 60 cfi = true 61 cfi_cross_dso = true 62 debug = false 63 } 64 include_dirs = [ 65 "$dsoftbus_dfx_path/interface/include", 66 "$dsoftbus_root_path/interfaces/kits/common", 67 "//third_party/bounds_checking_function/include", 68 ] 69 sources = softbus_anonymizer_src 70 defines += [ "__STDC_FORMAT_MACROS" ] 71 if (is_asan) { 72 defines += [ "ASAN_BUILD" ] 73 } 74 75 public_configs = [ ":dsoftbus_anonymizer_interface_std" ] 76 deps = [ 77 "$dsoftbus_dfx_path/log:softbus_dfx_log", 78 "//third_party/bounds_checking_function:libsec_shared", 79 ] 80 external_deps = [ "hilog:libhilog" ] 81 innerapi_tags = [ "platformsdk_indirect" ] 82 83 install_images = [ 84 system_base_dir, 85 updater_base_dir, 86 ] 87 88 part_name = "dsoftbus" 89 subsystem_name = "communication" 90 } 91} 92