communication_dsoftbus/tests/sdk/BUILD.gn
baiyuxin e6984ff48f Fix: Synchronize the modification of softbus_client to softbus_client_static
Signed-off-by: baiyuxin <baiyuxin3@huawei.com>
2024-09-26 11:11:59 +08:00

130 lines
4.0 KiB
Plaintext

# Copyright (c) 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/config/features.gni")
import("//build/ohos.gni")
import("//build/test.gni")
import("../../core/common/dfx/dsoftbus_dfx.gni")
import("../../dsoftbus.gni")
import("../../sdk/bus_center/bus_center_sdk.gni")
import("../../sdk/frame/frame_sdk.gni")
import("../../sdk/transmission/trans_sdk.gni")
common_client_src = bus_center_sdk_src + softbus_client_frame_src +
trans_session_manager_sdk_src
common_client_inc = bus_center_sdk_inc + softbus_client_frame_inc +
trans_session_manager_sdk_inc
common_client_deps = bus_center_sdk_deps + trans_session_manager_sdk_deps
common_client_deps += [
"$dsoftbus_core_path/common:softbus_utils",
"$dsoftbus_dfx_path/anonymize:softbus_dfx_anonymizer",
"$dsoftbus_dfx_path/log:softbus_dfx_log",
"$dsoftbus_root_path/adapter:softbus_adapter",
]
common_client_ex_deps = []
if (defined(ohos_lite)) {
if (dsoftbus_feature_build_shared_sdk == true) {
build_type = "shared_library"
} else {
build_type = "static_library"
}
if (ohos_kernel_type != "liteos_m") {
common_client_ex_deps += [ "bounds_checking_function:libsec_shared" ]
}
} else {
common_client_ex_deps += [ "bounds_checking_function:libsec_shared" ]
}
config("dsoftbus_sdk_interface") {
include_dirs = [
"$dsoftbus_dfx_path/hisysevent_adapter/include",
"$dsoftbus_dfx_path/interface/include",
"$dsoftbus_root_path/interfaces/inner_kits/lnn",
"$dsoftbus_root_path/interfaces/inner_kits/transport",
"$dsoftbus_root_path/interfaces/kits",
"$dsoftbus_root_path/interfaces/kits/bus_center",
"$dsoftbus_root_path/interfaces/kits/common",
"$dsoftbus_root_path/interfaces/kits/discovery",
"$dsoftbus_root_path/interfaces/kits/transport",
"$dsoftbus_sdk_path/transmission/session/cpp/include",
]
if (enhanced_kits_broadcast) {
include_dirs +=
[ "$dsoftbus_root_path/dsoftbus_enhance/interfaces/kits/broadcast" ]
}
if (dsoftbus_feature_ex_kits) {
include_dirs +=
[ "$dsoftbus_root_path/dsoftbus_enhance/interfaces/kits/bus_center" ]
}
if (schema_enhanced) {
include_dirs += [
"$dsoftbus_core_path/transmission/common/include",
"$dsoftbus_root_path/dsoftbus_enhance/interfaces/kits/transport",
]
}
}
ohos_static_library("softbus_client_static") {
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
branch_protector_ret = "pac_ret"
sources = common_client_src
include_dirs = common_client_inc
deps = common_client_deps
external_deps = common_client_ex_deps
public_configs = [ ":dsoftbus_sdk_interface" ]
defines += TRANS_SDK_DEFINES
if (defined(ohos_lite)) {
cflags_cc = [ "-stdc=c++14" ]
if (board_toolchain_type != "iccarm") {
configs -= [ "//build/lite/config:language_cpp" ]
cflags = [ "-fPIC" ]
cflags_cc += [ "-fPIC" ]
} else {
cflags = [
"--diag_suppress",
"Pa153",
]
}
ldflags = [ "-lstdc++" ]
} else {
cflags = [ "-fPIC" ]
cflags_cc = [ "-std=c++14" ]
if (is_standard_system) {
external_deps += [
"access_token:libaccesstoken_sdk",
"c_utils:utils",
"hilog:libhilog",
"ipc:ipc_single",
]
}
if (defined(global_parts_info) &&
defined(global_parts_info.hiviewdfx_hicollie)) {
external_deps += [ "hicollie:libhicollie" ]
}
part_name = "dsoftbus"
subsystem_name = "communication"
}
}