# 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. if (defined(ohos_lite)) { import("//build/lite/config/component/lite_component.gni") import("//foundation/communication/dhcp/dhcp_lite.gni") } else { import("//build/ohos.gni") import("//foundation/communication/dhcp/dhcp.gni") } local_sdk_include_dirs = [ "$DHCP_ROOT_DIR/services", "$DHCP_ROOT_DIR/interfaces", "$DHCP_ROOT_DIR/interfaces/inner_api", "$DHCP_ROOT_DIR/interfaces/kits/c", "$DHCP_ROOT_DIR/interfaces/inner_api/include", "$DHCP_ROOT_DIR/interfaces/inner_api/interfaces", "$DHCP_ROOT_DIR/frameworks/native/include", "$DHCP_ROOT_DIR/frameworks/native/interfaces", "$DHCP_ROOT_DIR/frameworks/native/c_adapter/inc", ] if (defined(ohos_lite)) { shared_library("dhcp_sdk") { sources = [ "c_adapter/src/dhcp_c_service.cpp", "c_adapter/src/dhcp_c_utils.cpp", "src/dhcp_client.cpp", "src/dhcp_client_callback_stub_lite.cpp", "src/dhcp_client_proxy_lite.cpp", "src/dhcp_event.cpp", "src/dhcp_server.cpp", "src/dhcp_server_callback_stub_lite.cpp", "src/dhcp_server_impl.cpp", "src/dhcp_server_proxy_lite.cpp", ] include_dirs = local_sdk_include_dirs include_dirs += [ "//commonlibrary/c_utils/base/include" ] deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single", "//foundation/systemabilitymgr/samgr_lite/samgr:samgr", "//third_party/bounds_checking_function:libsec_shared", ] configs -= [ "//build/lite/config:language_cpp" ] cflags_cc = [ "-std=c++17", "-fno-rtti", ] defines = [ "OHOS_ARCH_LITE" ] ldflags = [ "-fPIC", "-Wl,-E", ] } } else { local_sdk_sources = [ "c_adapter/src/dhcp_c_service.cpp", "c_adapter/src/dhcp_c_utils.cpp", "src/dhcp_client.cpp", "src/dhcp_client_callback_stub.cpp", "src/dhcp_event.cpp", "src/dhcp_sa_manager.cpp", "src/dhcp_server.cpp", ] config("dhcp_sdk_header") { visibility = [ ":*" ] include_dirs = local_sdk_include_dirs } config("dhcp_sdk_config") { visibility = [ ":*" ] include_dirs = local_sdk_include_dirs cflags = [ "-std=c++17", "-fno-rtti", ] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } } ohos_source_set("dhcp_client_proxy_impl") { branch_protector_ret = "pac_ret" sanitize = { cfi = true boundary_sanitize = true cfi_cross_dso = true debug = false } part_name = "dhcp" subsystem_name = "communication" sources = [ "src/dhcp_client_impl.cpp", "src/dhcp_client_proxy.cpp", ] configs = [ ":dhcp_sdk_config", ":dhcp_sdk_header", ] defines = [] external_deps = [ "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "samgr:samgr_proxy", ] } ohos_source_set("dhcp_server_proxy_impl") { branch_protector_ret = "pac_ret" sanitize = { cfi = true boundary_sanitize = true cfi_cross_dso = true debug = false } part_name = "dhcp" subsystem_name = "communication" sources = [ "src/dhcp_server_impl.cpp", "src/dhcp_server_proxy.cpp", ] configs = [ ":dhcp_sdk_config", ":dhcp_sdk_header", ] defines = [] external_deps = [ "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "samgr:samgr_proxy", ] } ohos_shared_library("dhcp_sdk") { branch_protector_ret = "pac_ret" sanitize = { cfi = true boundary_sanitize = true cfi_cross_dso = true debug = false } install_enable = true sources = local_sdk_sources sources += [ "src/dhcp_server_callback_stub.cpp" ] deps = [ ":dhcp_client_proxy_impl", ":dhcp_server_proxy_impl", ] external_deps = [ "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [] cflags_cc = [ "-std=c++17", "-fno-rtti", ] ldflags = [ "-fPIC", "-Wl,-E", ] configs = [ ":dhcp_sdk_config", ":dhcp_sdk_header", ] public_configs = [ ":dhcp_sdk_header" ] part_name = "dhcp" subsystem_name = "communication" innerapi_tags = [ "platformsdk" ] } }