2024-04-20 09:55:44 +00:00
|
|
|
# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
|
2021-06-01 16:05:35 +00:00
|
|
|
# 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")
|
|
|
|
import("../adapter/core_adapter.gni")
|
|
|
|
import("../authentication/authentication.gni")
|
|
|
|
import("../bus_center/bus_center_server.gni")
|
2023-11-14 08:51:50 +00:00
|
|
|
import("../common/dfx/dsoftbus_dfx.gni")
|
2023-05-05 12:39:13 +00:00
|
|
|
import("../common/security/permission/permission.gni")
|
|
|
|
import("../connection/conn.gni")
|
|
|
|
import("../discovery/disc.gni")
|
|
|
|
import("../transmission/trans.gni")
|
2021-06-01 16:05:35 +00:00
|
|
|
|
2023-09-22 01:22:55 +00:00
|
|
|
dsoftbus_root_path = "../.."
|
|
|
|
dsoftbus_feature_product_config_path =
|
|
|
|
"${dsoftbus_root_path}/adapter/default_config"
|
|
|
|
softbus_adapter_config = "${dsoftbus_root_path}/adapter/default_config"
|
|
|
|
dsoftbus_core_path = "${dsoftbus_root_path}/core"
|
|
|
|
|
2021-11-01 13:36:35 +00:00
|
|
|
dsoftbus_server_common_src =
|
|
|
|
auth_server_src + bus_center_server_src + conn_manager_src +
|
|
|
|
disc_server_src + trans_session_src + softbus_permission_src
|
|
|
|
dsoftbus_server_common_inc =
|
|
|
|
auth_server_inc + bus_center_server_inc + conn_manager_inc +
|
|
|
|
disc_server_inc + trans_session_inc + softbus_permission_inc
|
|
|
|
dsoftbus_server_common_deps =
|
2023-07-17 15:33:04 +00:00
|
|
|
auth_server_deps + bus_center_server_deps + disc_server_deps +
|
2023-11-04 09:34:16 +00:00
|
|
|
conn_manager_common_deps + trans_session_deps + softbus_permission_deps
|
2021-06-01 16:05:35 +00:00
|
|
|
|
2021-11-01 13:36:35 +00:00
|
|
|
if (defined(ohos_lite)) {
|
|
|
|
copy("permission_json") {
|
|
|
|
sources = [ "$dsoftbus_core_path/common/security/permission/softbus_trans_permission.json" ]
|
|
|
|
outputs = [ "$root_out_dir/etc/softbus_trans_permission.json" ]
|
|
|
|
}
|
|
|
|
if (ohos_kernel_type == "liteos_m") {
|
|
|
|
static_library("softbus_server_frame") {
|
2024-01-04 11:31:28 +00:00
|
|
|
defines += AUTH_SERVER_DEFINES
|
2022-04-28 02:36:16 +00:00
|
|
|
defines += [ "__STDC_FORMAT_MACROS" ]
|
2021-11-01 13:36:35 +00:00
|
|
|
include_dirs = dsoftbus_server_common_inc
|
|
|
|
include_dirs += [
|
|
|
|
"$dsoftbus_root_path/core/frame/common/include",
|
2024-04-20 09:55:44 +00:00
|
|
|
"$dsoftbus_root_path/interfaces/inner_kits/lnn",
|
2021-11-01 13:36:35 +00:00
|
|
|
"$dsoftbus_root_path/interfaces/kits",
|
|
|
|
"$dsoftbus_root_path/interfaces/kits/bus_center",
|
|
|
|
"$dsoftbus_root_path/interfaces/kits/transport",
|
|
|
|
"$dsoftbus_root_path/interfaces/kits/common",
|
2022-07-27 15:55:45 +00:00
|
|
|
"$dsoftbus_root_path/core/common/dfx/hisysevent_adapter/include",
|
2023-11-14 08:51:50 +00:00
|
|
|
"$dsoftbus_root_path/core/common/dfx/interface/include",
|
2021-11-01 13:36:35 +00:00
|
|
|
"$softbus_adapter_config/spec_config",
|
|
|
|
]
|
|
|
|
sources = dsoftbus_server_common_src
|
|
|
|
sources += [
|
|
|
|
"common/src/softbus_server_frame.c",
|
|
|
|
"mini/src/softbus_server_stub.c",
|
|
|
|
]
|
2022-07-26 09:16:18 +00:00
|
|
|
if (board_toolchain_type != "iccarm") {
|
|
|
|
cflags = [
|
|
|
|
"-Wall",
|
|
|
|
"-fPIC",
|
|
|
|
"-std=c99",
|
|
|
|
]
|
|
|
|
cflags_cc = cflags
|
2022-08-24 12:39:29 +00:00
|
|
|
} else {
|
|
|
|
include_dirs += [
|
|
|
|
"//kernel/liteos_m/components/net/lwip-2.1/porting/include",
|
|
|
|
"//third_party/lwip/src/include",
|
|
|
|
]
|
|
|
|
cflags = [
|
|
|
|
"--diag_suppress",
|
|
|
|
"Pe301",
|
|
|
|
]
|
2022-07-26 09:16:18 +00:00
|
|
|
}
|
2021-11-01 13:36:35 +00:00
|
|
|
deps = dsoftbus_server_common_deps
|
|
|
|
deps += [
|
|
|
|
"$dsoftbus_root_path/adapter:softbus_adapter",
|
|
|
|
"$dsoftbus_root_path/core/common:softbus_utils",
|
2024-01-23 08:41:47 +00:00
|
|
|
"$dsoftbus_root_path/core/common/dfx/hidumper_adapter:softbus_dfx_dump",
|
2024-04-30 10:32:26 +00:00
|
|
|
"$dsoftbus_root_path/core/connection/wifi_direct_cpp:wifi_direct",
|
2021-11-01 13:36:35 +00:00
|
|
|
"//build/lite/config/component/cJSON:cjson_static",
|
|
|
|
]
|
2024-04-13 08:28:47 +00:00
|
|
|
external_deps = [ "device_auth:deviceauth_sdk" ]
|
2024-04-28 12:05:48 +00:00
|
|
|
external_deps += auth_server_ex_deps
|
2023-11-14 08:51:50 +00:00
|
|
|
public_deps =
|
|
|
|
[ "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log" ]
|
2023-07-19 13:44:00 +00:00
|
|
|
if (support_bluetooth &&
|
|
|
|
(dsoftbus_feature_conn_br || dsoftbus_feature_conn_ble)) {
|
|
|
|
deps += [
|
|
|
|
"//foundation/communication/bluetooth/frameworks/inner:btframework",
|
|
|
|
]
|
|
|
|
include_dirs += [
|
|
|
|
"//foundation/communication/bluetooth/interfaces/inner_api/include",
|
|
|
|
"//foundation/communication/bluetooth/interfaces/inner_api/include/c_header",
|
|
|
|
]
|
|
|
|
}
|
2021-11-01 13:36:35 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
shared_library("softbus_server_frame") {
|
2024-01-04 11:31:28 +00:00
|
|
|
defines += AUTH_SERVER_DEFINES
|
2022-04-28 02:36:16 +00:00
|
|
|
defines += [ "__STDC_FORMAT_MACROS" ]
|
2021-11-01 13:36:35 +00:00
|
|
|
include_dirs = dsoftbus_server_common_inc
|
|
|
|
include_dirs += [
|
|
|
|
"common/include",
|
|
|
|
"small/init/include",
|
|
|
|
"small/client_manager/include",
|
|
|
|
"$softbus_adapter_common/include",
|
|
|
|
"$softbus_adapter_config/spec_config",
|
|
|
|
"$dsoftbus_root_path/interfaces/kits/transport",
|
2022-07-27 15:55:45 +00:00
|
|
|
"$dsoftbus_root_path/core/common/dfx/hisysevent_adapter/include",
|
2023-11-14 08:51:50 +00:00
|
|
|
"$dsoftbus_root_path/core/common/dfx/interface/include",
|
2022-09-15 13:44:07 +00:00
|
|
|
"//commonlibrary/utils_lite/include",
|
2021-11-01 13:36:35 +00:00
|
|
|
]
|
|
|
|
sources = dsoftbus_server_common_src
|
|
|
|
sources += [
|
|
|
|
"common/src/softbus_server_frame.c",
|
|
|
|
"small/client_manager/src/softbus_client_info_manager.c",
|
|
|
|
"small/init/src/bus_center_server_stub.c",
|
|
|
|
"small/init/src/disc_server_stub.c",
|
|
|
|
"small/init/src/softbus_server_stub.c",
|
|
|
|
"small/init/src/trans_server_stub.c",
|
|
|
|
]
|
2021-07-13 07:10:49 +00:00
|
|
|
|
2021-11-01 13:36:35 +00:00
|
|
|
cflags = [
|
|
|
|
"-Wall",
|
|
|
|
"-fPIC",
|
|
|
|
"-fno-builtin",
|
|
|
|
"-std=c99",
|
|
|
|
]
|
|
|
|
cflags_cc = cflags
|
|
|
|
deps = dsoftbus_server_common_deps
|
|
|
|
deps += [
|
|
|
|
":permission_json",
|
|
|
|
"$dsoftbus_root_path/adapter:softbus_adapter",
|
|
|
|
"$dsoftbus_root_path/core/common:softbus_utils",
|
2024-01-23 08:41:47 +00:00
|
|
|
"$dsoftbus_root_path/core/common/dfx/hidumper_adapter:softbus_dfx_dump",
|
2024-04-30 10:32:26 +00:00
|
|
|
"$dsoftbus_root_path/core/connection/wifi_direct_cpp:wifi_direct",
|
2021-11-01 13:36:35 +00:00
|
|
|
"//build/lite/config/component/cJSON:cjson_shared",
|
2022-05-05 06:51:21 +00:00
|
|
|
"//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single",
|
2022-07-21 11:11:29 +00:00
|
|
|
"//foundation/systemabilitymgr/samgr_lite/samgr:samgr",
|
2021-11-01 13:36:35 +00:00
|
|
|
]
|
2024-04-13 08:28:47 +00:00
|
|
|
external_deps = [
|
|
|
|
"bounds_checking_function:libsec_shared",
|
|
|
|
"device_auth:deviceauth_sdk",
|
|
|
|
]
|
2024-04-28 12:05:48 +00:00
|
|
|
external_deps += auth_server_ex_deps
|
2023-11-14 08:51:50 +00:00
|
|
|
public_deps =
|
|
|
|
[ "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log" ]
|
2023-07-19 13:44:00 +00:00
|
|
|
if (support_bluetooth &&
|
|
|
|
(dsoftbus_feature_conn_br || dsoftbus_feature_conn_ble)) {
|
|
|
|
deps += [
|
|
|
|
"//foundation/communication/bluetooth/frameworks/inner:btframework",
|
|
|
|
]
|
|
|
|
include_dirs += [
|
|
|
|
"//foundation/communication/bluetooth/interfaces/inner_api/include",
|
|
|
|
"//foundation/communication/bluetooth/interfaces/inner_api/include/c_header",
|
|
|
|
]
|
|
|
|
}
|
2021-11-01 13:36:35 +00:00
|
|
|
}
|
|
|
|
executable("softbus_server") {
|
|
|
|
sources = [ "small/init/src/softbus_server_main.c" ]
|
|
|
|
include_dirs = [ "common/include" ]
|
|
|
|
deps = [ ":softbus_server_frame" ]
|
|
|
|
cflags = [ "-fPIC" ]
|
|
|
|
}
|
2021-06-01 16:05:35 +00:00
|
|
|
}
|
|
|
|
} else {
|
2021-11-01 13:36:35 +00:00
|
|
|
ohos_prebuilt_etc("softbus_server.rc") {
|
|
|
|
relative_install_dir = "init"
|
2022-03-24 09:32:57 +00:00
|
|
|
if (use_musl) {
|
2022-03-30 09:10:41 +00:00
|
|
|
source = "$dsoftbus_root_path/core/frame/$os_type/init/src/softbus_server_musl.cfg"
|
2022-03-24 09:32:57 +00:00
|
|
|
} else {
|
|
|
|
source =
|
2022-03-30 09:10:41 +00:00
|
|
|
"$dsoftbus_root_path/core/frame/$os_type/init/src/softbus_server.cfg"
|
2022-03-24 09:32:57 +00:00
|
|
|
}
|
2021-12-22 08:59:43 +00:00
|
|
|
|
2022-06-01 09:26:07 +00:00
|
|
|
part_name = "dsoftbus"
|
2021-11-01 13:36:35 +00:00
|
|
|
subsystem_name = "communication"
|
|
|
|
}
|
|
|
|
ohos_prebuilt_etc("softbus_permission_json") {
|
|
|
|
source = "$dsoftbus_root_path/core/common/security/permission/softbus_trans_permission.json"
|
|
|
|
install_enable = true
|
|
|
|
relative_install_dir = "communication/softbus"
|
2022-06-01 09:26:07 +00:00
|
|
|
part_name = "dsoftbus"
|
2021-11-01 13:36:35 +00:00
|
|
|
}
|
|
|
|
ohos_shared_library("softbus_server") {
|
2023-08-29 09:12:43 +00:00
|
|
|
sanitize = {
|
|
|
|
cfi = true
|
|
|
|
cfi_cross_dso = true
|
|
|
|
debug = false
|
|
|
|
blocklist = "../cfi_blocklist.txt"
|
|
|
|
}
|
2023-10-23 07:51:39 +00:00
|
|
|
branch_protector_ret = "pac_ret"
|
|
|
|
|
2024-01-04 11:31:28 +00:00
|
|
|
defines += AUTH_SERVER_DEFINES
|
2022-04-28 02:36:16 +00:00
|
|
|
defines += [ "__STDC_FORMAT_MACROS" ]
|
2021-11-01 13:36:35 +00:00
|
|
|
include_dirs = dsoftbus_server_common_inc
|
|
|
|
include_dirs += [
|
|
|
|
"$dsoftbus_root_path/core/frame/common/include",
|
2022-03-30 09:10:41 +00:00
|
|
|
"$dsoftbus_root_path/core/frame/$os_type/client_manager/include",
|
|
|
|
"$dsoftbus_root_path/core/frame/$os_type/init/include",
|
2021-11-01 13:36:35 +00:00
|
|
|
"$dsoftbus_root_path/interfaces/kits/common",
|
2021-07-13 07:10:49 +00:00
|
|
|
"$dsoftbus_root_path/interfaces/kits/transport",
|
2022-06-01 09:26:07 +00:00
|
|
|
"$dsoftbus_feature_product_config_path/spec_config",
|
2021-11-01 13:36:35 +00:00
|
|
|
"$dsoftbus_root_path/core/common/include",
|
2022-07-30 01:15:12 +00:00
|
|
|
"$dsoftbus_root_path/core/common/dfx/hidumper_adapter/include",
|
2022-07-27 15:55:45 +00:00
|
|
|
"$dsoftbus_root_path/core/common/dfx/hisysevent_adapter/include",
|
2023-11-14 08:51:50 +00:00
|
|
|
"$dsoftbus_root_path/core/common/dfx/interface/include",
|
2021-06-01 16:05:35 +00:00
|
|
|
]
|
2021-11-01 13:36:35 +00:00
|
|
|
sources = dsoftbus_server_common_src
|
|
|
|
sources += [
|
2022-03-30 09:10:41 +00:00
|
|
|
"$dsoftbus_root_path/sdk/frame/$os_type/src/if_softbus_client.cpp",
|
2022-10-16 13:35:54 +00:00
|
|
|
"$os_type/client_manager/src/permission_status_change_cb.cpp",
|
2022-03-30 09:10:41 +00:00
|
|
|
"$os_type/client_manager/src/softbus_client_info_manager.cpp",
|
|
|
|
"$os_type/init/src/if_softbus_server.cpp",
|
|
|
|
"$os_type/init/src/softbus_server.cpp",
|
|
|
|
"$os_type/init/src/softbus_server_death_recipient.cpp",
|
|
|
|
"$os_type/init/src/softbus_server_stub.cpp",
|
2022-03-31 12:02:06 +00:00
|
|
|
"common/src/softbus_server_frame.c",
|
2021-06-01 16:05:35 +00:00
|
|
|
]
|
2021-11-01 13:36:35 +00:00
|
|
|
deps = dsoftbus_server_common_deps
|
|
|
|
deps += [
|
|
|
|
":softbus_permission_json",
|
|
|
|
":softbus_server.rc",
|
2021-08-10 03:16:24 +00:00
|
|
|
"$dsoftbus_root_path/adapter:softbus_adapter",
|
2021-11-01 13:36:35 +00:00
|
|
|
"$dsoftbus_root_path/core/common:softbus_utils",
|
2023-12-02 07:08:26 +00:00
|
|
|
"$dsoftbus_root_path/core/common/dfx/hidumper_adapter:softbus_dfx_dump",
|
2024-04-27 04:28:09 +00:00
|
|
|
"$dsoftbus_root_path/core/connection/wifi_direct_cpp:wifi_direct",
|
2024-03-30 07:05:07 +00:00
|
|
|
"$dsoftbus_root_path/sdk:softbus_client",
|
2021-06-01 16:05:35 +00:00
|
|
|
]
|
2024-04-26 03:06:29 +00:00
|
|
|
external_deps = [ "cJSON:cjson" ]
|
2024-04-28 12:05:48 +00:00
|
|
|
external_deps += auth_server_ex_deps
|
2023-11-14 08:51:50 +00:00
|
|
|
public_deps = [ "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log" ]
|
2022-09-22 09:49:52 +00:00
|
|
|
dsoftbus_server_common_external_deps =
|
|
|
|
bus_center_server_external_deps + disc_server_external_deps +
|
2023-05-22 12:37:47 +00:00
|
|
|
softbus_permission_external_deps + trans_session_external_deps +
|
|
|
|
conn_manager_external_deps
|
2021-11-01 13:36:35 +00:00
|
|
|
if (is_standard_system) {
|
2024-04-26 03:06:29 +00:00
|
|
|
external_deps += dsoftbus_server_common_external_deps
|
2021-11-01 13:36:35 +00:00
|
|
|
external_deps += [
|
2022-05-26 06:40:22 +00:00
|
|
|
"access_token:libaccesstoken_sdk",
|
2022-07-22 03:03:30 +00:00
|
|
|
"access_token:libprivacy_sdk",
|
2022-06-17 02:04:38 +00:00
|
|
|
"device_auth:deviceauth_sdk",
|
2023-06-27 03:16:32 +00:00
|
|
|
"hilog:libhilog",
|
2021-11-01 13:36:35 +00:00
|
|
|
"ipc:ipc_core",
|
2024-05-05 16:47:21 +00:00
|
|
|
"kv_store:distributeddata_inner",
|
2021-11-01 13:36:35 +00:00
|
|
|
"safwk:system_ability_fwk",
|
2022-07-21 11:11:29 +00:00
|
|
|
"samgr:samgr_proxy",
|
2021-11-01 13:36:35 +00:00
|
|
|
]
|
2023-12-09 14:41:34 +00:00
|
|
|
if (!defined(global_parts_info) ||
|
|
|
|
defined(global_parts_info.deviceprofile_device_info_manager)) {
|
|
|
|
external_deps += [
|
|
|
|
"device_info_manager:distributed_device_profile_common",
|
|
|
|
"device_info_manager:distributed_device_profile_sdk",
|
|
|
|
]
|
|
|
|
}
|
2023-05-31 07:38:19 +00:00
|
|
|
if (!defined(global_parts_info) ||
|
|
|
|
defined(global_parts_info.bundlemanager_bundle_framework)) {
|
|
|
|
external_deps += [ "bundle_framework:appexecfwk_core" ]
|
|
|
|
cflags = [ "-DSUPPORT_BUNDLENAME" ]
|
|
|
|
}
|
2024-04-20 09:55:44 +00:00
|
|
|
|
|
|
|
if (enhanced) {
|
|
|
|
cflags += [ "-DENHANCED_FLAG" ]
|
2024-04-22 02:19:53 +00:00
|
|
|
external_deps += [ "device_certificate_manager:device_cert_mgr_sdk" ]
|
2024-04-20 09:55:44 +00:00
|
|
|
}
|
2021-11-01 13:36:35 +00:00
|
|
|
}
|
|
|
|
|
2022-06-01 09:26:07 +00:00
|
|
|
part_name = "dsoftbus"
|
2021-11-01 13:36:35 +00:00
|
|
|
subsystem_name = "communication"
|
2021-07-13 07:10:49 +00:00
|
|
|
}
|
2021-06-01 16:05:35 +00:00
|
|
|
}
|