Files
phs_v1.0.1.0/base/security/device_auth/services/BUILD.gn

308 lines
9.6 KiB
Plaintext
Raw Normal View History

2024-09-27 19:16:49 +08:00
# Copyright (C) 2021-2023 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("//base/security/device_auth/deps_adapter/deviceauth_hals.gni")
import("//build/ohos.gni")
import("deviceauth.gni")
config("deviceauth_config") {
include_dirs = [ "//base/security/device_auth/interfaces/inner_api" ]
}
include_dirs = inc_path + hals_inc_path
if (os_level == "mini" || os_level == "small") {
static_library("deviceauth") {
public_configs = [ ":deviceauth_config" ]
include_dirs += [
"//third_party/cJSON",
"//commonlibrary/utils_lite/include",
"//third_party/bounds_checking_function/include",
"//foundation/communication/dsoftbus/interfaces/kits/common",
"//foundation/communication/dsoftbus/interfaces/kits/transport",
"//foundation/communication/dsoftbus/interfaces/inner_kits/transport",
"${dev_frameworks_path}/inc/hiview_adapter",
]
sources = deviceauth_files
defines = [ "HILOG_ENABLE" ]
defines += deviceauth_defines
deps = [
"${deps_adapter_path}:${hal_module_name}",
"//build/lite/config/component/cJSON:cjson_shared",
"//commonlibrary/utils_lite:utils",
]
if (enable_soft_bus_channel) {
deps += [ "//foundation/communication/dsoftbus/sdk:softbus_client" ]
}
if (enable_extend_plugin) {
defines += [ "DEV_AUTH_PLUGIN_ENABLE" ]
if (os_level == "mini") {
sources += [
"${dev_frameworks_path}/src/plugin_adapter/static_plugin_adapter.c",
]
} else {
sources += [
"${dev_frameworks_path}/src/plugin_adapter/account_auth_plugin_proxy.c",
"${dev_frameworks_path}/src/plugin_adapter/account_lifecycle_plugin_proxy.c",
"${dev_frameworks_path}/src/plugin_adapter/dynamic_plugin_adapter.c",
"${dev_frameworks_path}/src/plugin_adapter/ext_part_proxy.c",
]
}
}
if (board_toolchain_type == "iccarm" && os_level == "mini") {
cflags = [
"--diag_suppress",
"Pe546,Pe223,Pe111,Pe188",
]
} else {
cflags = build_flags
}
cflags += [
"-DHICHAIN_THREAD_STACK_SIZE=${deviceauth_hichain_thread_stack_size}",
]
if (ohos_kernel_type == "linux" || ohos_kernel_type == "liteos_a") {
include_dirs +=
[ "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog" ]
deps += [
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
"//third_party/bounds_checking_function:libsec_shared",
]
} else {
include_dirs +=
[ "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite" ]
deps += [ "//base/hiviewdfx/hilog_lite/frameworks/mini:hilog_lite" ]
}
}
if (os_level == "mini") {
group("deviceauth_sdk") {
}
group("deviceauth_service") {
}
}
if (ohos_kernel_type == "linux" || ohos_kernel_type == "liteos_a") {
executable("deviceauth_service") {
include_dirs += [
"//third_party/cJSON",
"//commonlibrary/utils_lite/include",
"//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog",
"//third_party/bounds_checking_function/include",
"${frameworks_path}/inc/lite",
"//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
"${dev_frameworks_path}/inc/hiview_adapter",
]
sources = deviceauth_ipc_files
sources += [
"${frameworks_path}/src/ipc_service.c",
"${frameworks_path}/src/lite/ipc_service_init.c",
]
defines = [ "HILOG_ENABLE" ]
if (ohos_kernel_type == "linux") {
defines += [ "__LINUX__" ]
}
ldflags = [ "-pthread" ]
deps = [
":deviceauth",
"${deps_adapter_path}:${hal_module_name}",
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
"//build/lite/config/component/cJSON:cjson_shared",
"//commonlibrary/utils_lite:utils",
"//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single",
"//foundation/systemabilitymgr/samgr_lite/samgr:samgr",
"//third_party/bounds_checking_function:libsec_shared",
]
}
shared_library("deviceauth_sdk") {
public_configs = [ ":deviceauth_config" ]
include_dirs += [
"//third_party/cJSON",
"//commonlibrary/utils_lite/include",
"//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog",
"//third_party/bounds_checking_function/include",
"${frameworks_path}/inc/lite",
"//foundation/communication/ipc/interfaces/innerkits/c/ipc/include",
"//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
"${dev_frameworks_path}/inc/hiview_adapter",
]
sources = deviceauth_ipc_files
sources += [ "${frameworks_path}/src/ipc_sdk.c" ]
defines = [ "HILOG_ENABLE" ]
if (ohos_kernel_type == "linux") {
defines += [ "__LINUX__" ]
}
cflags = build_flags
cflags += [ "-fPIC" ]
deps = [
"${deps_adapter_path}:${hal_module_name}",
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
"//commonlibrary/utils_lite:utils",
"//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single",
"//foundation/systemabilitymgr/samgr_lite/samgr:samgr",
"//third_party/bounds_checking_function:libsec_shared",
]
}
}
} else {
ohos_static_library("deviceauth") {
subsystem_name = "security"
part_name = "device_auth"
include_dirs += [
"//third_party/cJSON",
"${frameworks_path}/inc/standard",
"${dev_frameworks_path}/inc/hiview_adapter",
]
sources = deviceauth_files
sources += hiview_adapter_files
defines = deviceauth_defines
defines += [ "HILOG_ENABLE" ]
defines += [ "DEV_AUTH_HIVIEW_ENABLE" ]
cflags = build_flags
if (target_cpu == "arm") {
cflags += [ "-DBINDER_IPC_32BIT" ]
}
if (support_jsapi) {
defines += [ "SUPPORT_OS_ACCOUNT" ]
}
if (enable_extend_plugin) {
defines += [ "DEV_AUTH_PLUGIN_ENABLE" ]
sources += [
"${dev_frameworks_path}/src/plugin_adapter/account_auth_plugin_proxy.c",
"${dev_frameworks_path}/src/plugin_adapter/account_lifecycle_plugin_proxy.c",
"${dev_frameworks_path}/src/plugin_adapter/dynamic_plugin_adapter.c",
"${dev_frameworks_path}/src/plugin_adapter/ext_part_proxy.c",
]
}
deps = [
"${deps_adapter_path}:${hal_module_name}",
"//third_party/cJSON:cjson",
]
external_deps = [
"c_utils:utils",
"dsoftbus:softbus_client",
"hilog:libhilog",
"hisysevent:libhisysevent",
"hitrace:hitrace_meter",
]
if (support_jsapi) {
external_deps += [ "os_account:os_account_innerkits" ]
}
}
ohos_prebuilt_etc("auth_service.rc") {
source = "${frameworks_path}/src/standard/deviceauth_service.cfg"
relative_install_dir = "init"
subsystem_name = "security"
part_name = "device_auth"
}
group("etc") {
deps = [ ":auth_service.rc" ]
}
ohos_executable("deviceauth_service") {
subsystem_name = "security"
part_name = "device_auth"
install_enable = true
include_dirs += [
"//third_party/cJSON",
"${frameworks_path}/inc/standard",
"${dev_frameworks_path}/inc/permission_adapter",
"${dev_frameworks_path}/inc/hiview_adapter",
]
sources = deviceauth_ipc_files
sources += permission_adapter_files
sources += [ "${frameworks_path}/src/ipc_service.c" ]
defines = [ "HILOG_ENABLE" ]
defines += [ "DEV_AUTH_HIVIEW_ENABLE" ]
cflags = build_flags
if (target_cpu == "arm") {
cflags += [ "-DBINDER_IPC_32BIT" ]
}
deps = [
":auth_service.rc",
":deviceauth",
"${deps_adapter_path}:${hal_module_name}",
"//third_party/cJSON:cjson",
]
external_deps = [
"access_token:libaccesstoken_sdk",
"c_utils:utils",
"hilog:libhilog",
"hisysevent:libhisysevent",
"hitrace:hitrace_meter",
"init:libbegetutil",
"ipc:ipc_core",
"samgr:samgr_proxy",
]
}
ohos_shared_library("deviceauth_sdk") {
subsystem_name = "security"
part_name = "device_auth"
innerapi_tags = [ "platformsdk" ]
version_script = "device_auth.map"
public_configs = [ ":deviceauth_config" ]
include_dirs += [
"//third_party/cJSON",
"${frameworks_path}/inc/standard",
"${dev_frameworks_path}/inc/permission_adapter",
"${dev_frameworks_path}/inc/hiview_adapter",
]
sources = deviceauth_ipc_files
sources += permission_adapter_files
sources += [ "${frameworks_path}/src/ipc_sdk.c" ]
defines = [
"__LINUX__",
"HILOG_ENABLE",
]
cflags = build_flags
cflags += [ "-fPIC" ]
if (target_cpu == "arm") {
cflags += [ "-DBINDER_IPC_32BIT" ]
}
deps = [
"${deps_adapter_path}:${hal_module_name}",
"//third_party/cJSON:cjson",
]
external_deps = [
"access_token:libaccesstoken_sdk",
"c_utils:utils",
"hilog:libhilog",
"hisysevent:libhisysevent",
"hitrace:hitrace_meter",
"init:libbegetutil",
"ipc:ipc_single",
"samgr:samgr_proxy",
]
}
}