# Copyright (c) Huawei Technologies Co., Ltd. 2021-2023. All rights reserved.
# 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")
import("../../base/config.gni")
ohos_source_set("ipc") {
branch_protector_ret = "pac_ret"
part_name = "${OHOS_PROFILER_PART_NAME}"
subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
sources = [
"src/client_connection.cpp",
"src/client_map.cpp",
"src/service_entry.cpp",
"src/socket_context.cpp",
"src/unix_socket_client.cpp",
"src/unix_socket_server.cpp",
]
include_dirs = [
"include",
"../../base/include",
]
external_deps = [
"bounds_checking_function:libsec_shared",
"init:libbegetutil",
"protobuf:protobuf",
]
if (current_toolchain != host_toolchain) {
defines = [ "HAVE_HILOG" ]
}
public_configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ]
}
ohos_source_set("ipc_cfi") {
branch_protector_ret = "pac_ret"
part_name = "${OHOS_PROFILER_PART_NAME}"
subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
sources = [
"src/client_connection.cpp",
"src/client_map.cpp",
"src/service_entry.cpp",
"src/socket_context.cpp",
"src/unix_socket_client.cpp",
"src/unix_socket_server.cpp",
]
include_dirs = [
"include",
"../../base/include",
]
sanitize = {
cfi = true
cfi_cross_dso = true
cfi_vcall_icall_only = true
debug = false
}
external_deps = [
"bounds_checking_function:libsec_shared",
"init:libbegetutil",
"protobuf:protobuf",
]
if (current_toolchain != host_toolchain) {
defines = [ "HAVE_HILOG" ]
}
public_configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ]
}
ohos_executable("protoc_gen_ipc") {
branch_protector_ret = "pac_ret"
sources = [
"src/ipc_generator.cpp",
"src/ipc_generator_impl.cpp",
"src/main.cpp",
]
include_dirs = [ "include" ]
public_configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ]
external_deps = [
"protobuf:protobuf_lite_static",
"protobuf:protoc_static_lib(${host_toolchain})",
]
install_enable = false
subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
part_name = "${OHOS_PROFILER_PART_NAME}"
}
ohos_executable("protoencoder_plugin") {
branch_protector_ret = "pac_ret"
sources = [
"src/proto_encoder_plugin.cpp",
"src/proto_encoder_plugin_generator.cpp",
]
include_dirs = [ "include" ]
public_configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ]
external_deps = [
"protobuf:protobuf_lite_static",
"protobuf:protoc_static_lib(${host_toolchain})",
]
install_enable = false
subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
part_name = "${OHOS_PROFILER_PART_NAME}"
}