2021-07-23 06:15:53 +00:00
|
|
|
# Copyright (c) 2021 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.
|
|
|
|
|
2023-05-05 12:39:13 +00:00
|
|
|
import("../dsoftbus.gni")
|
2021-07-23 06:15:53 +00:00
|
|
|
|
2021-11-01 13:36:35 +00:00
|
|
|
if (defined(ohos_lite)) {
|
2022-01-17 08:25:13 +00:00
|
|
|
import("//build/lite/config/component/lite_component.gni")
|
2021-08-10 03:16:24 +00:00
|
|
|
config("dsoftbus_adapter_common_interface") {
|
|
|
|
include_dirs = [
|
|
|
|
"$softbus_adapter_common/include",
|
2022-03-28 03:13:43 +00:00
|
|
|
"$softbus_adapter_common/include/OS_adapter_define/linux",
|
2021-08-10 03:16:24 +00:00
|
|
|
"$softbus_adapter_config/spec_config",
|
2021-11-01 13:36:35 +00:00
|
|
|
"$dsoftbus_root_path/core/common/include",
|
|
|
|
"$hilog_lite_include_path",
|
2021-08-10 03:16:24 +00:00
|
|
|
]
|
2022-08-20 12:01:38 +00:00
|
|
|
if (board_name == "v200zr") {
|
|
|
|
defines = [ "DSOFTBUS_V200ZR" ]
|
|
|
|
}
|
2021-08-10 03:16:24 +00:00
|
|
|
}
|
|
|
|
|
2021-07-23 06:15:53 +00:00
|
|
|
common_include = [
|
2021-09-27 03:36:42 +00:00
|
|
|
"$dsoftbus_root_path/interfaces/kits",
|
|
|
|
"$dsoftbus_root_path/interfaces/kits/common",
|
2022-08-01 03:43:21 +00:00
|
|
|
"//base/startup/init/interfaces/innerkits/include/syspara",
|
2022-05-06 04:00:10 +00:00
|
|
|
"//third_party/bounds_checking_function/include",
|
2023-08-22 02:14:10 +00:00
|
|
|
"//third_party/json/include",
|
2021-08-10 03:16:24 +00:00
|
|
|
]
|
|
|
|
|
2021-07-23 06:15:53 +00:00
|
|
|
if (ohos_kernel_type == "liteos_m") {
|
|
|
|
static_library("softbus_adapter") {
|
2022-01-19 05:02:48 +00:00
|
|
|
include_dirs = common_include
|
2022-01-17 08:25:13 +00:00
|
|
|
include_dirs += [ "//kernel/liteos_m/kal/cmsis" ]
|
|
|
|
if (board_name == "hispark_pegasus") {
|
|
|
|
include_dirs +=
|
|
|
|
[ "$hispark_pegasus_sdk_path/third_party/lwip_sack/include" ]
|
2022-01-25 08:37:44 +00:00
|
|
|
defines = [ "HISPARK_PEGASUS_USE_NETIF_GET_ADDR" ]
|
2022-01-17 08:25:13 +00:00
|
|
|
}
|
2022-07-26 09:16:18 +00:00
|
|
|
if (board_toolchain_type == "iccarm") {
|
2022-08-24 12:39:29 +00:00
|
|
|
include_dirs += [
|
|
|
|
"//kernel/liteos_m/components/net/lwip-2.1/porting/include",
|
|
|
|
"//third_party/lwip/src/include",
|
|
|
|
]
|
2022-07-26 09:16:18 +00:00
|
|
|
cflags = [
|
|
|
|
"--diag_suppress",
|
2022-07-31 09:16:44 +00:00
|
|
|
"Pe226,Pe513",
|
2022-07-26 09:16:18 +00:00
|
|
|
]
|
|
|
|
ldflags = [ "-lpthread" ]
|
|
|
|
} else {
|
|
|
|
cflags = [ "-Wall" ]
|
|
|
|
}
|
2021-08-10 03:16:24 +00:00
|
|
|
sources = [
|
2022-07-30 04:26:51 +00:00
|
|
|
"$softbus_adapter_common/dfx/softbus_adapter_hisysevent_mini.c",
|
2023-06-30 07:44:56 +00:00
|
|
|
"$softbus_adapter_common/dfx/softbus_adapter_hitrace_virtual.c",
|
2021-11-22 03:36:14 +00:00
|
|
|
"$softbus_adapter_common/kernel/liteos_m/lnn_ip_utils_adapter.c",
|
2021-08-10 03:16:24 +00:00
|
|
|
"$softbus_adapter_common/kernel/liteos_m/softbus_adapter_file.c",
|
|
|
|
"$softbus_adapter_common/kernel/liteos_m/softbus_adapter_mem.c",
|
|
|
|
"$softbus_adapter_common/kernel/liteos_m/softbus_adapter_timer.c",
|
2022-10-16 15:23:53 +00:00
|
|
|
"$softbus_adapter_common/kernel/posix/softbus_adapter_socket.c",
|
|
|
|
"$softbus_adapter_common/kernel/posix/softbus_adapter_thread.c",
|
2021-08-19 02:04:25 +00:00
|
|
|
"$softbus_adapter_common/log/softbus_adapter_log.c",
|
2022-07-25 08:24:19 +00:00
|
|
|
"$softbus_adapter_common/range/softbus_adapter_range.c",
|
2021-08-10 03:16:24 +00:00
|
|
|
"$softbus_adapter_config/spec_config/softbus_config_adapter.c",
|
|
|
|
]
|
2022-08-20 12:01:38 +00:00
|
|
|
if (board_name == "v200zr") {
|
|
|
|
sources = []
|
|
|
|
sources = [
|
|
|
|
"$softbus_adapter_common/dfx/softbus_adapter_hisysevent_mini.c",
|
2023-06-30 07:44:56 +00:00
|
|
|
"$softbus_adapter_common/dfx/softbus_adapter_hitrace_virtual.c",
|
2022-08-20 12:01:38 +00:00
|
|
|
"$softbus_adapter_common/kernel/liteos_m/lnn_ip_utils_adapter.c",
|
|
|
|
"$softbus_adapter_common/kernel/liteos_m/softbus_adapter_mem.c",
|
|
|
|
"$softbus_adapter_common/kernel/liteos_m/softbus_adapter_timer.c",
|
2022-10-16 15:23:53 +00:00
|
|
|
"$softbus_adapter_common/kernel/posix/softbus_adapter_file.c",
|
|
|
|
"$softbus_adapter_common/kernel/posix/softbus_adapter_socket.c",
|
|
|
|
"$softbus_adapter_common/kernel/posix/softbus_adapter_thread.c",
|
2022-08-20 12:01:38 +00:00
|
|
|
"$softbus_adapter_common/log/softbus_adapter_log.c",
|
|
|
|
"$softbus_adapter_common/range/softbus_adapter_range.c",
|
|
|
|
"$softbus_adapter_config/spec_config/softbus_config_adapter.c",
|
|
|
|
]
|
|
|
|
}
|
2022-04-29 07:56:23 +00:00
|
|
|
|
2022-11-28 06:33:34 +00:00
|
|
|
deps = [ "$hilog_lite_deps_path" ]
|
2022-07-04 09:42:47 +00:00
|
|
|
|
2022-06-01 09:26:07 +00:00
|
|
|
if (dsoftbus_feature_encrypt == 0) {
|
2022-04-29 07:56:23 +00:00
|
|
|
sources +=
|
|
|
|
[ "$softbus_adapter_common/mbedtls/softbus_adapter_crypto.c" ]
|
|
|
|
deps += [ "//third_party/mbedtls" ]
|
2022-06-01 09:26:07 +00:00
|
|
|
} else if (dsoftbus_feature_encrypt == 1) {
|
2022-04-29 07:56:23 +00:00
|
|
|
sources +=
|
|
|
|
[ "$softbus_adapter_common/openssl/softbus_adapter_crypto.c" ]
|
2023-05-06 03:41:21 +00:00
|
|
|
deps += [ "//third_party/openssl/ohos_lite:openssl_shared" ]
|
2022-04-29 06:28:41 +00:00
|
|
|
}
|
2021-08-10 03:16:24 +00:00
|
|
|
public_configs = [ ":dsoftbus_adapter_common_interface" ]
|
2021-07-23 06:15:53 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
shared_library("softbus_adapter") {
|
2022-01-19 05:02:48 +00:00
|
|
|
include_dirs = common_include
|
2021-07-23 06:15:53 +00:00
|
|
|
cflags = [
|
2021-08-10 03:16:24 +00:00
|
|
|
"-Wall",
|
2021-11-01 13:36:35 +00:00
|
|
|
"-Werror",
|
2021-08-10 03:16:24 +00:00
|
|
|
"-fPIC",
|
2021-11-01 13:36:35 +00:00
|
|
|
"-fno-builtin",
|
|
|
|
"-std=c99",
|
2021-08-10 03:16:24 +00:00
|
|
|
]
|
2021-11-01 13:36:35 +00:00
|
|
|
cflags_cc = [ "-fPIC" ]
|
2021-08-10 03:16:24 +00:00
|
|
|
sources = [
|
2022-07-30 06:05:53 +00:00
|
|
|
"$softbus_adapter_common/dfx/softbus_adapter_hisysevent_mini.c",
|
2023-06-30 07:44:56 +00:00
|
|
|
"$softbus_adapter_common/dfx/softbus_adapter_hitrace_virtual.c",
|
2023-08-22 02:14:10 +00:00
|
|
|
"$softbus_adapter_common/json/nlohmann/softbus_adapter_json.cpp",
|
2022-10-16 15:02:20 +00:00
|
|
|
"$softbus_adapter_common/kernel/posix/lnn_ip_utils_adapter.c",
|
|
|
|
"$softbus_adapter_common/kernel/posix/softbus_adapter_file.c",
|
|
|
|
"$softbus_adapter_common/kernel/posix/softbus_adapter_mem.c",
|
|
|
|
"$softbus_adapter_common/kernel/posix/softbus_adapter_socket.c",
|
|
|
|
"$softbus_adapter_common/kernel/posix/softbus_adapter_thread.c",
|
|
|
|
"$softbus_adapter_common/kernel/posix/softbus_adapter_timer.c",
|
2021-08-19 02:04:25 +00:00
|
|
|
"$softbus_adapter_common/log/softbus_adapter_log.c",
|
2023-08-22 02:14:10 +00:00
|
|
|
"$softbus_adapter_common/perf/softbus_adapter_perf.c",
|
2022-07-25 08:24:19 +00:00
|
|
|
"$softbus_adapter_common/range/softbus_adapter_range.c",
|
2021-08-10 03:16:24 +00:00
|
|
|
"$softbus_adapter_config/spec_config/softbus_config_adapter.c",
|
2021-07-23 06:15:53 +00:00
|
|
|
]
|
2021-08-31 09:33:05 +00:00
|
|
|
deps = [
|
2022-11-28 06:33:34 +00:00
|
|
|
"$hilog_lite_deps_path",
|
2022-08-01 03:43:21 +00:00
|
|
|
"//base/startup/init/interfaces/innerkits:libbegetutil",
|
2021-08-31 09:33:05 +00:00
|
|
|
"//third_party/bounds_checking_function:libsec_shared",
|
|
|
|
]
|
2022-07-04 09:42:47 +00:00
|
|
|
|
2022-06-01 09:26:07 +00:00
|
|
|
if (dsoftbus_feature_encrypt == 0) {
|
2022-04-29 07:56:23 +00:00
|
|
|
sources +=
|
|
|
|
[ "$softbus_adapter_common/mbedtls/softbus_adapter_crypto.c" ]
|
|
|
|
deps += [ "//third_party/mbedtls" ]
|
2022-06-01 09:26:07 +00:00
|
|
|
} else if (dsoftbus_feature_encrypt == 1) {
|
2022-04-29 07:56:23 +00:00
|
|
|
sources +=
|
|
|
|
[ "$softbus_adapter_common/openssl/softbus_adapter_crypto.c" ]
|
2023-05-06 03:41:21 +00:00
|
|
|
deps += [ "//third_party/openssl/ohos_lite:openssl_shared" ]
|
2022-04-29 06:28:41 +00:00
|
|
|
}
|
2021-08-10 03:16:24 +00:00
|
|
|
public_configs = [ ":dsoftbus_adapter_common_interface" ]
|
2021-07-23 06:15:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2021-08-10 03:16:24 +00:00
|
|
|
config("config_adapter_common") {
|
2021-07-23 06:15:53 +00:00
|
|
|
include_dirs = [
|
2021-08-10 03:16:24 +00:00
|
|
|
"$softbus_adapter_common/include",
|
2022-03-28 03:13:43 +00:00
|
|
|
"$softbus_adapter_common/include/OS_adapter_define/linux",
|
2022-06-01 09:26:07 +00:00
|
|
|
"$dsoftbus_feature_product_config_path/spec_config",
|
2021-08-19 02:04:25 +00:00
|
|
|
"$dsoftbus_root_path/core/common/include",
|
2023-05-05 12:03:08 +00:00
|
|
|
"//base/hiviewdfx/hitrace/interfaces/native/innerkits/include",
|
2021-07-23 06:15:53 +00:00
|
|
|
]
|
2021-08-10 03:16:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ohos_shared_library("softbus_adapter") {
|
2023-08-29 09:12:43 +00:00
|
|
|
sanitize = {
|
|
|
|
cfi = true
|
|
|
|
cfi_cross_dso = true
|
|
|
|
debug = false
|
|
|
|
}
|
2021-08-23 02:25:11 +00:00
|
|
|
include_dirs = [
|
2021-08-24 03:19:15 +00:00
|
|
|
"$dsoftbus_root_path/interfaces/kits",
|
|
|
|
"$dsoftbus_root_path/interfaces/kits/common",
|
2022-07-21 02:47:30 +00:00
|
|
|
"//commonlibrary/c_utils/base/include",
|
2022-05-06 04:00:10 +00:00
|
|
|
"//third_party/bounds_checking_function/include",
|
2023-06-30 07:44:56 +00:00
|
|
|
"//third_party/json/include",
|
2021-08-23 02:25:11 +00:00
|
|
|
]
|
2021-08-10 03:16:24 +00:00
|
|
|
sources = [
|
2022-06-01 09:26:07 +00:00
|
|
|
"$dsoftbus_feature_product_config_path/spec_config/softbus_config_adapter.c",
|
2022-07-27 15:55:45 +00:00
|
|
|
"$softbus_adapter_common/dfx/softbus_adapter_hisysevent.cpp",
|
2023-06-30 07:44:56 +00:00
|
|
|
"$softbus_adapter_common/dfx/softbus_adapter_hitrace.c",
|
|
|
|
"$softbus_adapter_common/json/nlohmann/softbus_adapter_json.cpp",
|
2022-10-16 15:02:20 +00:00
|
|
|
"$softbus_adapter_common/kernel/posix/lnn_ip_utils_adapter.c",
|
|
|
|
"$softbus_adapter_common/kernel/posix/softbus_adapter_file.c",
|
|
|
|
"$softbus_adapter_common/kernel/posix/softbus_adapter_mem.c",
|
|
|
|
"$softbus_adapter_common/kernel/posix/softbus_adapter_socket.c",
|
|
|
|
"$softbus_adapter_common/kernel/posix/softbus_adapter_thread.c",
|
|
|
|
"$softbus_adapter_common/kernel/posix/softbus_adapter_timer.c",
|
2021-08-19 02:04:25 +00:00
|
|
|
"$softbus_adapter_common/log/softbus_adapter_log.c",
|
2023-06-30 07:44:56 +00:00
|
|
|
"$softbus_adapter_common/perf/softbus_adapter_perf.c",
|
2021-08-10 03:16:24 +00:00
|
|
|
]
|
2022-12-27 07:26:31 +00:00
|
|
|
public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
|
2022-09-20 01:07:09 +00:00
|
|
|
native_source_path = rebase_path("$dsoftbus_root_path")
|
|
|
|
|
|
|
|
ble_enhanced_impl =
|
|
|
|
"dsoftbus_enhance/adapter/common/range/softbus_adapter_range.c"
|
|
|
|
enhanced_range = exec_script("$dsoftbus_root_path/check_sub_module.py",
|
|
|
|
[
|
|
|
|
"$native_source_path",
|
|
|
|
"$ble_enhanced_impl",
|
|
|
|
],
|
|
|
|
"value")
|
2023-07-03 15:14:11 +00:00
|
|
|
if (enhanced_range) {
|
|
|
|
include_dirs += [
|
|
|
|
"$dsoftbus_root_path/dsoftbus_enhance/adapter/common/mlps/include",
|
|
|
|
"$dsoftbus_root_path/dsoftbus_enhance/core/bus_center/lnn/lane_hub/mlps/include",
|
|
|
|
"$dsoftbus_root_path/dsoftbus_enhance/core/bus_center/lnn/lane_hub/mlps/interface",
|
|
|
|
]
|
|
|
|
sources += [
|
|
|
|
"$dsoftbus_root_path/dsoftbus_enhance/adapter/common/mlps/src/softbus_adapter_mlps.cpp",
|
|
|
|
"$dsoftbus_root_path/dsoftbus_enhance/core/bus_center/lnn/lane_hub/mlps/src/mlps.cpp",
|
|
|
|
]
|
|
|
|
}
|
2022-09-20 01:07:09 +00:00
|
|
|
|
2023-07-17 15:33:04 +00:00
|
|
|
external_deps = []
|
2022-11-01 03:19:42 +00:00
|
|
|
if (enhanced_range && defined(global_parts_info.msdp_algorithm)) {
|
2022-09-20 01:07:09 +00:00
|
|
|
include_dirs += [ "//base/msdp/algorithm/ble_range/include" ]
|
|
|
|
sources += [ "$dsoftbus_root_path/dsoftbus_enhance/adapter/common/range/softbus_adapter_range.c" ]
|
2023-07-17 15:33:04 +00:00
|
|
|
external_deps += [ "algorithm:msdp_ble_range" ]
|
2022-09-20 01:07:09 +00:00
|
|
|
} else {
|
|
|
|
sources += [ "$softbus_adapter_common/range/softbus_adapter_range.c" ]
|
|
|
|
}
|
|
|
|
|
2022-06-01 09:26:07 +00:00
|
|
|
if (dsoftbus_feature_encrypt == 0) {
|
2022-04-29 07:56:23 +00:00
|
|
|
sources += [ "$softbus_adapter_common/mbedtls/softbus_adapter_crypto.c" ]
|
|
|
|
public_deps += [ "//third_party/mbedtls" ]
|
2022-06-01 09:26:07 +00:00
|
|
|
} else if (dsoftbus_feature_encrypt == 1) {
|
2022-04-29 07:56:23 +00:00
|
|
|
sources += [ "$softbus_adapter_common/openssl/softbus_adapter_crypto.c" ]
|
|
|
|
public_deps += [ "//third_party/openssl:libcrypto_shared" ]
|
2022-04-29 06:28:41 +00:00
|
|
|
}
|
2021-08-10 03:16:24 +00:00
|
|
|
public_configs = [ ":config_adapter_common" ]
|
|
|
|
if (is_standard_system) {
|
2023-07-17 15:33:04 +00:00
|
|
|
external_deps += [
|
2023-06-27 03:16:32 +00:00
|
|
|
"hilog:libhilog",
|
|
|
|
"hisysevent:libhisysevent",
|
|
|
|
"hitrace:libhitracechain",
|
2023-05-20 14:48:55 +00:00
|
|
|
"init:libbegetutil",
|
2022-07-27 15:55:45 +00:00
|
|
|
]
|
2021-08-10 03:16:24 +00:00
|
|
|
}
|
2023-05-17 02:07:35 +00:00
|
|
|
innerapi_tags = [ "platformsdk_indirect" ]
|
2022-06-01 09:26:07 +00:00
|
|
|
part_name = "dsoftbus"
|
2021-07-23 06:15:53 +00:00
|
|
|
subsystem_name = "communication"
|
|
|
|
}
|
2021-08-10 03:16:24 +00:00
|
|
|
}
|