2021-06-01 16:04:36 +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.
|
|
|
|
|
|
|
|
import("//build/ohos.gni")
|
2023-06-03 07:06:33 +00:00
|
|
|
HDC_PATH = "."
|
2022-04-26 09:35:01 +00:00
|
|
|
import("//developtools/hdc/hdc.gni")
|
2021-06-01 16:04:36 +00:00
|
|
|
|
2022-06-24 10:34:27 +00:00
|
|
|
py_out_dir = "$root_out_dir/gen/" + rebase_path(".", "//")
|
|
|
|
|
2022-04-22 02:53:36 +00:00
|
|
|
declare_args() {
|
|
|
|
# suggestion: uv threads number from 16 - 256
|
2023-04-26 06:57:41 +00:00
|
|
|
hdcd_uv_thread_size = 4
|
2022-04-22 02:53:36 +00:00
|
|
|
hdc_uv_thread_size = 128
|
|
|
|
}
|
|
|
|
|
2021-06-01 16:04:36 +00:00
|
|
|
hdc_common_sources = [
|
2023-06-08 02:47:34 +00:00
|
|
|
"src/common/async_cmd.cpp",
|
|
|
|
"src/common/auth.cpp",
|
|
|
|
"src/common/base.cpp",
|
|
|
|
"src/common/channel.cpp",
|
|
|
|
"src/common/circle_buffer.cpp",
|
2024-06-14 08:47:58 +00:00
|
|
|
"src/common/compress.cpp",
|
2023-06-08 02:47:34 +00:00
|
|
|
"src/common/debug.cpp",
|
2024-06-14 08:47:58 +00:00
|
|
|
"src/common/decompress.cpp",
|
|
|
|
"src/common/entry.cpp",
|
2023-06-08 02:47:34 +00:00
|
|
|
"src/common/file.cpp",
|
|
|
|
"src/common/file_descriptor.cpp",
|
|
|
|
"src/common/forward.cpp",
|
2024-06-14 08:47:58 +00:00
|
|
|
"src/common/header.cpp",
|
2023-06-08 02:47:34 +00:00
|
|
|
"src/common/session.cpp",
|
|
|
|
"src/common/task.cpp",
|
|
|
|
"src/common/tcp.cpp",
|
|
|
|
"src/common/transfer.cpp",
|
|
|
|
"src/common/usb.cpp",
|
2021-06-01 16:04:36 +00:00
|
|
|
]
|
2022-06-24 10:34:27 +00:00
|
|
|
|
|
|
|
hash_sources = [
|
2023-06-08 02:47:34 +00:00
|
|
|
"scripts/hdc_hash_gen.py",
|
|
|
|
"src/common/base.cpp",
|
|
|
|
"src/common/channel.h",
|
|
|
|
"src/common/session.h",
|
|
|
|
"src/common/transfer.h",
|
2022-06-24 10:34:27 +00:00
|
|
|
]
|
|
|
|
|
2022-02-09 06:11:30 +00:00
|
|
|
if (hdc_support_uart) {
|
2023-06-08 02:47:34 +00:00
|
|
|
hdc_common_sources += [ "src/common/uart.cpp" ]
|
2022-02-09 06:11:30 +00:00
|
|
|
}
|
2021-06-01 16:04:36 +00:00
|
|
|
config("hdc_config") {
|
2022-06-24 10:34:27 +00:00
|
|
|
include_dirs = [
|
2023-06-08 02:47:34 +00:00
|
|
|
"src/common",
|
2022-06-24 10:34:27 +00:00
|
|
|
"${py_out_dir}",
|
|
|
|
]
|
2021-06-01 16:04:36 +00:00
|
|
|
cflags_cc = [ "-std=c++17" ]
|
2022-02-09 06:11:30 +00:00
|
|
|
if (is_mingw) {
|
|
|
|
cflags_cc += [ "-Wno-inconsistent-dllimport" ] # in mingw some sec api will
|
|
|
|
# overwrite by utilsecurec
|
|
|
|
}
|
2021-06-01 16:04:36 +00:00
|
|
|
}
|
|
|
|
|
2023-02-25 12:17:54 +00:00
|
|
|
template("hdcd_source_set") {
|
|
|
|
forward_variables_from(invoker, "*")
|
|
|
|
|
|
|
|
ohos_source_set(target_name) {
|
|
|
|
use_exceptions = true
|
|
|
|
sources = [
|
|
|
|
"src/daemon/daemon.cpp",
|
|
|
|
"src/daemon/daemon_app.cpp",
|
2024-03-05 04:52:18 +00:00
|
|
|
"src/daemon/daemon_bridge.cpp",
|
2023-02-25 12:17:54 +00:00
|
|
|
"src/daemon/daemon_forward.cpp",
|
|
|
|
"src/daemon/daemon_tcp.cpp",
|
|
|
|
"src/daemon/daemon_unity.cpp",
|
|
|
|
"src/daemon/daemon_usb.cpp",
|
|
|
|
"src/daemon/jdwp.cpp",
|
|
|
|
"src/daemon/main.cpp",
|
|
|
|
"src/daemon/shell.cpp",
|
|
|
|
"src/daemon/system_depend.cpp",
|
|
|
|
]
|
|
|
|
sources += hdc_common_sources
|
2021-06-01 16:04:36 +00:00
|
|
|
|
2023-02-25 12:17:54 +00:00
|
|
|
defines = [
|
|
|
|
"HARMONY_PROJECT",
|
|
|
|
"USE_CONFIG_UV_THREADS",
|
|
|
|
"SIZE_THREAD_POOL=$hdcd_uv_thread_size",
|
2023-03-08 03:01:59 +00:00
|
|
|
"HDC_HILOG",
|
2023-02-28 09:45:17 +00:00
|
|
|
"OPENSSL_SUPPRESS_DEPRECATED",
|
2023-02-25 12:17:54 +00:00
|
|
|
]
|
2021-06-01 16:04:36 +00:00
|
|
|
|
2023-02-25 12:17:54 +00:00
|
|
|
if (hdc_debug) {
|
|
|
|
defines += [ "HDC_DEBUG" ]
|
|
|
|
}
|
|
|
|
if (hdc_support_uart) {
|
|
|
|
defines += [ "HDC_SUPPORT_UART" ]
|
|
|
|
sources += [ "src/daemon/daemon_uart.cpp" ]
|
|
|
|
}
|
|
|
|
if (js_jdwp_connect) {
|
|
|
|
defines += [ "JS_JDWP_CONNECT" ]
|
|
|
|
}
|
2024-01-17 14:07:13 +00:00
|
|
|
if (use_musl) {
|
2024-07-25 01:08:33 +00:00
|
|
|
if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) {
|
2024-01-17 14:07:13 +00:00
|
|
|
defines += [ "CONFIG_USE_JEMALLOC_DFX_INIF" ]
|
|
|
|
}
|
|
|
|
}
|
2024-01-11 01:57:26 +00:00
|
|
|
if (is_emulator) {
|
|
|
|
defines += [ "HDC_EMULATOR" ]
|
|
|
|
}
|
2024-08-27 13:55:57 +00:00
|
|
|
if (build_variant == "user") {
|
|
|
|
defines += [ "IS_RELEASE_VERSION" ]
|
|
|
|
}
|
2023-02-25 12:17:54 +00:00
|
|
|
configs = [ ":hdc_config" ]
|
|
|
|
|
2024-04-20 08:58:17 +00:00
|
|
|
deps = []
|
2021-06-01 16:04:36 +00:00
|
|
|
|
2023-02-25 12:17:54 +00:00
|
|
|
deps += [
|
|
|
|
":hdc_hash_gen",
|
2023-06-08 02:47:34 +00:00
|
|
|
"src/daemon/etc:daemon_etc",
|
2023-02-25 12:17:54 +00:00
|
|
|
]
|
2022-01-13 07:07:24 +00:00
|
|
|
|
2023-02-25 12:17:54 +00:00
|
|
|
if (hdc_jdwp_test) {
|
|
|
|
defines += [ "SIMULATE_JDWP" ]
|
2023-06-08 02:47:34 +00:00
|
|
|
deps += [ "src/test/jdwp:jdwp_test" ]
|
2023-02-25 12:17:54 +00:00
|
|
|
}
|
2022-06-24 10:34:27 +00:00
|
|
|
|
2023-02-25 12:17:54 +00:00
|
|
|
external_deps = [
|
2024-05-14 10:59:16 +00:00
|
|
|
"bounds_checking_function:libsec_shared",
|
2024-05-23 14:41:40 +00:00
|
|
|
"c_utils:utils",
|
2023-06-19 09:14:03 +00:00
|
|
|
"hilog:libhilog",
|
2023-02-25 12:17:54 +00:00
|
|
|
"init:libbegetutil",
|
2024-04-20 08:58:17 +00:00
|
|
|
"libuv:uv",
|
|
|
|
"lz4:liblz4_static",
|
|
|
|
"openssl:libcrypto_shared",
|
2023-02-25 12:17:54 +00:00
|
|
|
]
|
2022-02-09 06:11:30 +00:00
|
|
|
|
2023-02-25 12:17:54 +00:00
|
|
|
if (build_selinux) {
|
2024-04-20 08:58:17 +00:00
|
|
|
external_deps += [ "selinux:libselinux" ]
|
2023-02-25 12:17:54 +00:00
|
|
|
defines += [ "SURPPORT_SELINUX" ]
|
|
|
|
if (image_name == "updater") {
|
|
|
|
defines += [ "UPDATER_MODE" ]
|
|
|
|
}
|
2023-03-01 02:33:44 +00:00
|
|
|
if (image_name == "system") {
|
|
|
|
defines += [ "HDC_TRACE" ]
|
2023-06-19 09:14:03 +00:00
|
|
|
external_deps += [ "hitrace:hitrace_meter" ]
|
2023-03-01 02:33:44 +00:00
|
|
|
}
|
2023-02-25 12:17:54 +00:00
|
|
|
}
|
2022-06-24 10:34:27 +00:00
|
|
|
|
2023-02-25 12:17:54 +00:00
|
|
|
if (hdc_version_check) {
|
|
|
|
defines += [ "HDC_VERSION_CHECK" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
ldflags = [ "-rdynamic" ]
|
2023-06-08 02:47:34 +00:00
|
|
|
|
|
|
|
subsystem_name = "developtools"
|
|
|
|
part_name = "hdc"
|
2022-06-24 10:34:27 +00:00
|
|
|
}
|
2023-02-25 12:17:54 +00:00
|
|
|
}
|
2022-06-24 10:34:27 +00:00
|
|
|
|
2024-04-01 13:45:29 +00:00
|
|
|
if (product_name != "ohos-sdk") {
|
|
|
|
ohos_static_library("serialize_structs") {
|
|
|
|
sources = [
|
2024-04-09 02:54:04 +00:00
|
|
|
"hdc_rust/src/cffi/bridge.cpp",
|
2024-04-01 13:45:29 +00:00
|
|
|
"hdc_rust/src/cffi/cmd.cpp",
|
|
|
|
"hdc_rust/src/cffi/getparameter.cpp",
|
|
|
|
"hdc_rust/src/cffi/log.cpp",
|
|
|
|
"hdc_rust/src/cffi/mount.cpp",
|
|
|
|
"hdc_rust/src/cffi/mount_wrapper.cpp",
|
|
|
|
"hdc_rust/src/cffi/oh_usb.cpp",
|
|
|
|
"hdc_rust/src/cffi/sendmsg.cpp",
|
|
|
|
"hdc_rust/src/cffi/serial_struct.cpp",
|
|
|
|
"hdc_rust/src/cffi/sys_para.cpp",
|
|
|
|
"hdc_rust/src/cffi/transfer.cpp",
|
|
|
|
"hdc_rust/src/cffi/uart.cpp",
|
|
|
|
"hdc_rust/src/cffi/uart_wrapper.cpp",
|
|
|
|
"hdc_rust/src/cffi/usb_util.cpp",
|
|
|
|
"hdc_rust/src/cffi/usb_wrapper.cpp",
|
2024-04-29 13:20:45 +00:00
|
|
|
"hdc_rust/src/cffi/utils.cpp",
|
2024-04-01 13:45:29 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
external_deps = [
|
|
|
|
"bounds_checking_function:libsec_static",
|
|
|
|
"hilog:libhilog",
|
|
|
|
"init:libbegetutil",
|
|
|
|
"lz4:liblz4_static",
|
|
|
|
]
|
|
|
|
|
|
|
|
defines = [ "HDC_HILOG" ]
|
|
|
|
|
|
|
|
if (is_mac) {
|
|
|
|
defines = [ "HOST_MAC" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (build_selinux) {
|
|
|
|
external_deps += [ "selinux:libselinux" ]
|
|
|
|
defines += [ "SURPPORT_SELINUX" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
subsystem_name = "developtools"
|
|
|
|
part_name = "hdc"
|
|
|
|
}
|
|
|
|
|
2024-06-21 05:51:40 +00:00
|
|
|
ohos_rust_static_library("lib") {
|
2024-04-01 13:45:29 +00:00
|
|
|
crate_name = "hdc"
|
2024-06-21 05:51:40 +00:00
|
|
|
crate_type = "rlib"
|
2024-04-01 13:45:29 +00:00
|
|
|
crate_root = "hdc_rust/src/lib.rs"
|
|
|
|
sources = [ "hdc_rust/src/lib.rs" ]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":serialize_structs",
|
|
|
|
"//third_party/rust/crates/humantime:lib",
|
|
|
|
"//third_party/rust/crates/libc:lib",
|
|
|
|
"//third_party/rust/crates/log:lib",
|
|
|
|
"//third_party/rust/crates/rust-openssl/openssl:lib",
|
|
|
|
]
|
2024-06-25 14:25:24 +00:00
|
|
|
features = [ "daemon" ]
|
2024-04-09 02:54:04 +00:00
|
|
|
if (is_emulator && product_name != "ohos-sdk") {
|
2024-06-25 14:25:24 +00:00
|
|
|
features += [ "emulator" ]
|
2024-04-09 02:54:04 +00:00
|
|
|
}
|
2024-04-01 13:45:29 +00:00
|
|
|
external_deps = [
|
|
|
|
"hilog:hilog_rust",
|
|
|
|
"ylong_runtime:ylong_runtime",
|
|
|
|
]
|
|
|
|
subsystem_name = "developtools"
|
|
|
|
part_name = "hdc"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-25 12:17:54 +00:00
|
|
|
template("build_hdc") {
|
|
|
|
forward_variables_from(invoker, "*")
|
|
|
|
image_name = target_name
|
|
|
|
hdcd_source_set("hdcd_${image_name}_source") {
|
|
|
|
if (build_selinux) {
|
|
|
|
image_name = image_name
|
|
|
|
}
|
2023-06-08 02:47:34 +00:00
|
|
|
|
|
|
|
subsystem_name = "developtools"
|
|
|
|
part_name = "hdc"
|
2022-06-27 02:24:24 +00:00
|
|
|
}
|
|
|
|
|
2024-04-01 13:45:29 +00:00
|
|
|
if (image_name == "system") {
|
2024-07-17 08:18:44 +00:00
|
|
|
if (product_name != "ohos-sdk" || is_emulator) {
|
2024-04-01 13:45:29 +00:00
|
|
|
ohos_executable("hdcd_${image_name}_exe") {
|
2024-07-22 01:55:46 +00:00
|
|
|
sanitize = {
|
|
|
|
cfi = true
|
|
|
|
cfi_cross_dso = true
|
|
|
|
cfi_vcall_icall_only = true
|
|
|
|
debug = false
|
|
|
|
}
|
2024-04-01 13:45:29 +00:00
|
|
|
deps = [ ":hdcd_${image_name}_source" ]
|
2024-07-29 09:23:19 +00:00
|
|
|
external_deps = [ "hilog:libhilog" ]
|
2024-04-01 13:45:29 +00:00
|
|
|
output_name = "hdcd_${image_name}"
|
|
|
|
install_enable = false
|
|
|
|
subsystem_name = "developtools"
|
|
|
|
part_name = "hdc"
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
ohos_rust_executable("hdcd_${image_name}_exe") {
|
|
|
|
sources = [ "hdc_rust/src/daemon/main.rs" ]
|
2024-06-25 14:25:24 +00:00
|
|
|
if (use_clang_coverage) {
|
2024-06-27 02:20:40 +00:00
|
|
|
rustflags = [
|
2024-06-25 14:25:24 +00:00
|
|
|
"-C",
|
|
|
|
"instrument-coverage",
|
|
|
|
"-Clink-arg=--coverage",
|
|
|
|
]
|
|
|
|
}
|
2024-07-16 07:03:23 +00:00
|
|
|
rustflags = [ "-Cforce-frame-pointers=yes" ]
|
2024-04-01 13:45:29 +00:00
|
|
|
deps = [
|
|
|
|
"//third_party/rust/crates/env_logger:lib",
|
|
|
|
"//third_party/rust/crates/humantime:lib",
|
|
|
|
"//third_party/rust/crates/libc:lib",
|
|
|
|
"//third_party/rust/crates/log:lib",
|
|
|
|
"//third_party/rust/crates/nix:lib",
|
|
|
|
"//third_party/rust/crates/rust-openssl/openssl:lib",
|
|
|
|
]
|
2024-07-26 03:11:48 +00:00
|
|
|
external_deps = [ "hilog:hilog_rust" ]
|
2024-04-01 13:45:29 +00:00
|
|
|
|
2024-07-24 03:13:18 +00:00
|
|
|
if (product_name != "ohos-sdk") {
|
2024-07-22 08:49:45 +00:00
|
|
|
deps += [
|
|
|
|
":lib",
|
2024-07-22 09:00:14 +00:00
|
|
|
":serialize_structs",
|
2024-07-22 08:49:45 +00:00
|
|
|
]
|
2024-04-01 13:45:29 +00:00
|
|
|
external_deps += [ "ylong_runtime:ylong_runtime" ]
|
|
|
|
}
|
|
|
|
if (!defined(ohos_lite)) {
|
|
|
|
external_deps += [ "faultloggerd:panic_handler" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
output_name = "hdcd_${image_name}"
|
|
|
|
install_enable = false
|
|
|
|
features = [ "daemon" ]
|
2024-04-09 02:54:04 +00:00
|
|
|
if (is_emulator) {
|
|
|
|
features += [ "emulator" ]
|
|
|
|
}
|
2024-06-21 05:51:40 +00:00
|
|
|
rust_static_link = true
|
2024-04-01 13:45:29 +00:00
|
|
|
subsystem_name = "developtools"
|
|
|
|
part_name = "hdc"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
ohos_executable("hdcd_${image_name}_exe") {
|
2024-07-22 01:55:46 +00:00
|
|
|
sanitize = {
|
|
|
|
cfi = true
|
|
|
|
cfi_cross_dso = true
|
|
|
|
cfi_vcall_icall_only = true
|
|
|
|
debug = false
|
|
|
|
}
|
2024-04-01 13:45:29 +00:00
|
|
|
deps = [ ":hdcd_${image_name}_source" ]
|
2024-07-29 09:23:19 +00:00
|
|
|
external_deps = [ "hilog:libhilog" ]
|
2024-04-01 13:45:29 +00:00
|
|
|
output_name = "hdcd_${image_name}"
|
|
|
|
install_enable = false
|
|
|
|
subsystem_name = "developtools"
|
|
|
|
part_name = "hdc"
|
|
|
|
}
|
2023-02-25 12:17:54 +00:00
|
|
|
}
|
2022-01-13 07:07:24 +00:00
|
|
|
|
2023-02-25 12:17:54 +00:00
|
|
|
ohos_prebuilt_executable("hdcd_${image_name}") {
|
|
|
|
deps = [ ":hdcd_${image_name}_exe" ]
|
|
|
|
output = "${image_name}/hdcd"
|
|
|
|
install_enable = true
|
|
|
|
subsystem_name = "developtools"
|
|
|
|
part_name = "hdc"
|
|
|
|
source = "${root_out_dir}/${subsystem_name}/${part_name}/hdcd_${image_name}"
|
|
|
|
module_install_dir = "bin"
|
|
|
|
install_images = []
|
|
|
|
if (image_name == "updater") {
|
|
|
|
install_images = [ "updater" ]
|
|
|
|
} else {
|
|
|
|
install_images = [ "system" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-04-20 07:03:26 +00:00
|
|
|
|
2023-02-25 12:17:54 +00:00
|
|
|
build_hdc("system") {
|
|
|
|
}
|
|
|
|
|
|
|
|
build_hdc("updater") {
|
2021-06-01 16:04:36 +00:00
|
|
|
}
|
|
|
|
|
2022-10-14 02:45:10 +00:00
|
|
|
ohos_executable("hdc") {
|
2022-02-09 06:11:30 +00:00
|
|
|
use_exceptions = true
|
|
|
|
ldflags = []
|
|
|
|
libs = []
|
2021-06-01 16:04:36 +00:00
|
|
|
configs = [ ":hdc_config" ]
|
|
|
|
defines = [
|
|
|
|
"HDC_HOST",
|
|
|
|
"HARMONY_PROJECT",
|
2022-04-22 02:53:36 +00:00
|
|
|
"USE_CONFIG_UV_THREADS",
|
|
|
|
"SIZE_THREAD_POOL=$hdc_uv_thread_size",
|
2023-01-19 06:28:53 +00:00
|
|
|
"OPENSSL_SUPPRESS_DEPRECATED",
|
2021-06-01 16:04:36 +00:00
|
|
|
]
|
2021-09-13 09:30:00 +00:00
|
|
|
if (is_mac) {
|
|
|
|
defines += [ "HOST_MAC" ]
|
|
|
|
}
|
2022-02-09 06:11:30 +00:00
|
|
|
if (hdc_debug) {
|
|
|
|
defines += [ "HDC_DEBUG" ]
|
|
|
|
}
|
2021-06-01 16:04:36 +00:00
|
|
|
sources = [
|
|
|
|
"src/host/client.cpp",
|
2022-09-23 09:10:14 +00:00
|
|
|
"src/host/ext_client.cpp",
|
2021-06-01 16:04:36 +00:00
|
|
|
"src/host/host_app.cpp",
|
|
|
|
"src/host/host_forward.cpp",
|
|
|
|
"src/host/host_tcp.cpp",
|
|
|
|
"src/host/host_unity.cpp",
|
2022-06-22 01:47:04 +00:00
|
|
|
"src/host/host_updater.cpp",
|
2022-06-24 01:49:03 +00:00
|
|
|
"src/host/host_usb.cpp",
|
2021-06-01 16:04:36 +00:00
|
|
|
"src/host/main.cpp",
|
|
|
|
"src/host/server.cpp",
|
|
|
|
"src/host/server_for_client.cpp",
|
|
|
|
"src/host/translate.cpp",
|
|
|
|
]
|
|
|
|
sources += hdc_common_sources
|
2022-02-09 06:11:30 +00:00
|
|
|
if (hdc_support_uart) {
|
|
|
|
defines += [ "HDC_SUPPORT_UART" ]
|
|
|
|
sources += [ "src/host/host_uart.cpp" ]
|
|
|
|
}
|
2021-06-01 16:04:36 +00:00
|
|
|
|
2024-04-20 08:58:17 +00:00
|
|
|
deps = []
|
|
|
|
|
|
|
|
external_deps = [
|
|
|
|
"bounds_checking_function:libsec_static",
|
|
|
|
"libusb:libusb",
|
|
|
|
"libuv:uv_static",
|
|
|
|
"lz4:liblz4_static",
|
|
|
|
"openssl:libcrypto_static",
|
2021-06-01 16:04:36 +00:00
|
|
|
]
|
|
|
|
|
2022-06-24 10:34:27 +00:00
|
|
|
deps += [ ":hdc_hash_gen" ]
|
|
|
|
|
|
|
|
if (!(is_mingw || is_mac) && build_selinux) {
|
2024-04-20 08:58:17 +00:00
|
|
|
external_deps += [ "selinux:libselinux" ]
|
2022-06-24 10:34:27 +00:00
|
|
|
defines += [ "SURPPORT_SELINUX" ]
|
|
|
|
}
|
|
|
|
|
2022-06-27 02:24:24 +00:00
|
|
|
if (hdc_version_check) {
|
|
|
|
defines += [ "HDC_VERSION_CHECK" ]
|
|
|
|
}
|
|
|
|
|
2022-02-09 06:11:30 +00:00
|
|
|
if (is_mingw) {
|
2022-02-14 03:51:29 +00:00
|
|
|
static_link = false
|
2022-02-09 06:11:30 +00:00
|
|
|
|
|
|
|
# we should use something we define , not just _WIN32 (this will defined in some windows header)
|
|
|
|
defines += [ "HOST_MINGW" ] # we define this for mingw
|
|
|
|
defines += [ "WIN32_LEAN_AND_MEAN" ]
|
|
|
|
libs += [ "setupapi" ]
|
|
|
|
ldflags += [
|
|
|
|
"-Wl,--whole-archive",
|
|
|
|
"-lpthread",
|
|
|
|
"-Wl,--no-whole-archive",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_linux) {
|
2022-02-14 03:51:29 +00:00
|
|
|
static_link = false
|
2022-02-09 06:11:30 +00:00
|
|
|
defines += [ "HOST_LINUX" ]
|
|
|
|
ldflags += [
|
|
|
|
"-Wl,--whole-archive",
|
|
|
|
"-lpthread",
|
|
|
|
"-latomic",
|
|
|
|
"-ldl",
|
|
|
|
"-lrt",
|
|
|
|
"-Wl,--no-whole-archive",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2021-06-01 16:04:36 +00:00
|
|
|
subsystem_name = "developtools"
|
2022-04-26 09:35:01 +00:00
|
|
|
part_name = "hdc"
|
2021-06-01 16:04:36 +00:00
|
|
|
}
|
|
|
|
|
2022-04-26 09:35:01 +00:00
|
|
|
group("hdc_target") {
|
2021-06-01 16:04:36 +00:00
|
|
|
deps = [
|
2022-10-14 02:45:10 +00:00
|
|
|
":hdc",
|
2023-12-19 08:22:05 +00:00
|
|
|
":hdc_register",
|
2023-02-25 12:17:54 +00:00
|
|
|
":hdcd_system",
|
|
|
|
":hdcd_updater",
|
2021-06-01 16:04:36 +00:00
|
|
|
]
|
|
|
|
}
|
2022-02-09 06:11:30 +00:00
|
|
|
|
2022-04-26 09:35:01 +00:00
|
|
|
group("hdc_target_all") {
|
|
|
|
deps = [ ":hdc_target" ]
|
2022-02-09 06:11:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
group("hdc_all") {
|
|
|
|
testonly = true
|
2022-04-26 09:35:01 +00:00
|
|
|
deps = [ ":hdc_target_all" ]
|
2022-02-09 06:11:30 +00:00
|
|
|
}
|
2022-06-24 10:34:27 +00:00
|
|
|
|
2023-05-25 12:31:59 +00:00
|
|
|
group("hdc_test_target") {
|
|
|
|
testonly = true
|
2023-05-26 09:33:35 +00:00
|
|
|
deps = [ "test:hdc_fuzztest" ]
|
2023-05-25 12:31:59 +00:00
|
|
|
}
|
|
|
|
|
2022-06-24 10:34:27 +00:00
|
|
|
action("hdc_hash_gen") {
|
2023-06-08 02:47:34 +00:00
|
|
|
script = "scripts/hdc_hash_gen.py"
|
2022-06-24 10:34:27 +00:00
|
|
|
sources = hash_sources
|
|
|
|
outputs = [ "$py_out_dir" ]
|
|
|
|
args = [
|
|
|
|
"-f",
|
|
|
|
"hdc_hash_gen.h",
|
|
|
|
"-i",
|
|
|
|
rebase_path(".", root_build_dir),
|
|
|
|
"-o",
|
2022-08-01 03:22:07 +00:00
|
|
|
rebase_path("$py_out_dir" + "/", root_build_dir),
|
2022-06-24 10:34:27 +00:00
|
|
|
]
|
|
|
|
public_configs = [ ":hdc_config" ]
|
|
|
|
}
|
2023-12-19 01:58:47 +00:00
|
|
|
|
|
|
|
config("hdc_register_config") {
|
|
|
|
cflags_cc = [
|
|
|
|
"-fexceptions",
|
|
|
|
"-fno-complete-member-pointers",
|
|
|
|
"-Wno-implicit-fallthrough",
|
|
|
|
"-fvisibility=default",
|
|
|
|
"-frtti",
|
|
|
|
"-std=c++17",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
ohos_shared_library("hdc_register") {
|
|
|
|
deps = []
|
|
|
|
defines = [
|
|
|
|
"JS_JDWP_CONNECT",
|
|
|
|
"HDC_HILOG",
|
|
|
|
]
|
|
|
|
|
|
|
|
external_deps = [
|
2024-04-20 08:58:17 +00:00
|
|
|
"bounds_checking_function:libsec_shared",
|
2024-05-23 14:41:40 +00:00
|
|
|
"c_utils:utils",
|
2023-12-19 08:22:05 +00:00
|
|
|
"hilog:libhilog",
|
2024-07-03 09:30:03 +00:00
|
|
|
"init:libbeget_proxy",
|
|
|
|
"init:libbegetutil",
|
2024-04-20 08:58:17 +00:00
|
|
|
"libuv:uv",
|
2023-12-19 01:58:47 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
sources = [
|
|
|
|
"src/register/hdc_connect.cpp",
|
|
|
|
"src/register/hdc_jdwp.cpp",
|
|
|
|
]
|
|
|
|
|
2024-07-09 08:36:46 +00:00
|
|
|
configs = [ ":hdc_register_config" ]
|
2023-12-19 01:58:47 +00:00
|
|
|
|
2024-02-22 11:10:42 +00:00
|
|
|
innerapi_tags = [ "platformsdk" ]
|
2023-12-19 01:58:47 +00:00
|
|
|
subsystem_name = "developtools"
|
|
|
|
part_name = "hdc"
|
|
|
|
}
|
2024-07-09 08:36:46 +00:00
|
|
|
|
|
|
|
config("hdc_updater_config") {
|
|
|
|
include_dirs = [
|
|
|
|
"src/common",
|
|
|
|
"src/daemon",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
ohos_static_library("hdc_updater") {
|
|
|
|
sources = []
|
|
|
|
deps = []
|
|
|
|
defines = []
|
|
|
|
|
|
|
|
public_configs = [ ":hdc_updater_config" ]
|
|
|
|
subsystem_name = "developtools"
|
|
|
|
part_name = "hdc"
|
|
|
|
}
|