# Copyright (c) 2021-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("//foundation/communication/netstack/netstack_config.gni") group("common_utils") { deps = [ ":stack_utils_common", "napi_utils:napi_utils", ] } config("stack_utils_common_public_config") { include_dirs = [ "common_utils/include", "log/include", "$THIRD_PARTY_ROOT/curl/include", ] if (product_name == "ohcore") { defines = [ "OH_CORE_NETSTACK_PERMISSION_CHECK" ] } if (is_mingw) { defines = [ "WINDOWS_PLATFORM" ] } } ohos_shared_library("stack_utils_common") { sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" cflags = [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] cflags_cc = [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] sources = [ "common_utils/src/netstack_apipolicy_utils.cpp", "common_utils/src/netstack_bundle_utils.cpp", "common_utils/src/netstack_common_utils.cpp", ] public_configs = [ ":stack_utils_common_public_config" ] external_deps = [ "bounds_checking_function:libsec_shared", "hilog:libhilog", ] innerapi_tags = [ "platformsdk" ] part_name = "netstack" subsystem_name = "communication" }