communication_dsoftbus/sdk/BUILD.gn
baiyuxin 6b35e92cba fix: Add Feature To isolate access_token during compilation
Signed-off-by: baiyuxin <baiyuxin3@huawei.com>
2024-11-24 12:26:20 +08:00

145 lines
4.5 KiB
Plaintext

# 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("../dsoftbus.gni")
import("bus_center/bus_center_sdk.gni")
import("frame/frame_sdk.gni")
import("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_ext_deps = []
common_client_deps += [
"$dsoftbus_dfx_path:softbus_dfx",
"$dsoftbus_root_path/adapter:softbus_adapter",
"$dsoftbus_root_path/core/common:softbus_utils",
]
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_deps += [
"//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single",
"//foundation/systemabilitymgr/samgr_lite/samgr:samgr",
]
common_client_ext_deps += [ "bounds_checking_function:libsec_shared" ]
}
} else {
if (dsoftbus_feature_build_shared_sdk == true) {
build_type = "ohos_shared_library"
} else {
build_type = "ohos_static_library"
}
common_client_ext_deps += [ "bounds_checking_function:libsec_shared" ]
if (dsoftbus_access_token_feature) {
common_client_ext_deps += [ "access_token:libaccesstoken_sdk" ]
}
}
config("dsoftbus_sdk_interface") {
include_dirs = [
"$dsoftbus_dfx_path/interface/include",
"$dsoftbus_root_path/interfaces/kits",
"$dsoftbus_root_path/interfaces/inner_kits/lnn",
"$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_root_path/sdk/transmission/session/cpp/include",
"$dsoftbus_root_path/interfaces/inner_kits/transport",
]
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_root_path/dsoftbus_enhance/interfaces/kits/transport",
"$dsoftbus_root_path/core/transmission/common/include",
]
}
}
target(build_type, "softbus_client") {
sources = common_client_src
include_dirs = common_client_inc
deps = common_client_deps
external_deps = common_client_ext_deps + libsoftbus_stream_ext_deps
all_dependent_configs = [ ":dsoftbus_sdk_interface" ]
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 {
sanitize = {
ubsan = true
integer_overflow = true
boundary_sanitize = true
cfi = true
cfi_cross_dso = true
debug = false
}
branch_protector_ret = "pac_ret"
version_script = "libsoftbus_client_map"
cflags = [ "-fPIC" ]
cflags_cc = [ "-std=c++14" ]
if (is_standard_system) {
external_deps += [
"c_utils:utils",
"hicollie:libhicollie",
"hilog:libhilog",
"ipc:ipc_single",
]
}
if (dsoftbus_access_token_feature) {
external_deps += [ "access_token:libaccesstoken_sdk" ]
}
if (defined(global_parts_info) &&
defined(global_parts_info.hiviewdfx_hicollie)) {
external_deps += [ "hicollie:libhicollie" ]
}
innerapi_tags = [ "platformsdk_indirect" ]
part_name = "dsoftbus"
subsystem_name = "communication"
}
}