# Copyright (C) 2021-2022 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_base_include_dirs = [ "$DHCP_ROOT_DIR/services", "$DHCP_ROOT_DIR/services/dhcp_server/include", "$DHCP_ROOT_DIR/interfaces", "$DHCP_ROOT_DIR/interfaces/kits/c", "$DHCP_ROOT_DIR/interfaces/inner_api", "$DHCP_ROOT_DIR/interfaces/inner_api/include", "$DHCP_ROOT_DIR/frameworks/native/include", "$DHCP_ROOT_DIR/frameworks/native/interfaces", "$DHCP_ROOT_DIR/frameworks/native/src", "$DHCP_ROOT_DIR/frameworks/native/c_adapter/inc", "$DHCP_ROOT_DIR/services/dhcp_client/include", "$DHCP_ROOT_DIR/services/utils/include", ] if (defined(ohos_lite)) { dhcp_hilog_enable = true shared_library("dhcp_server") { sources = [ "src/address_utils.cpp", "src/common_util.cpp", "src/dhcp_address_pool.cpp", "src/dhcp_argument.cpp", "src/dhcp_binding.cpp", "src/dhcp_config.cpp", "src/dhcp_dhcpd.cpp", "src/dhcp_function.cpp", "src/dhcp_option.cpp", "src/dhcp_s_server.cpp", "src/dhcp_server_callback_proxy_lite.cpp", "src/dhcp_server_feature_lite.cpp", "src/dhcp_server_service_impl.cpp", "src/dhcp_server_stub_lite.cpp", ] include_dirs = local_base_include_dirs include_dirs += [ "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", "//third_party/bounds_checking_function/include", "//foundation/systemabilitymgr/samgr_lite/interfaces/innerkits/registry", "//foundation/systemabilitymgr/samgr_lite/interfaces/innerkits/samgr", ] deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", "//foundation/systemabilitymgr/samgr_lite/samgr:samgr", ] external_deps = [ "bounds_checking_function:libsec_shared" ] cflags_cc = [ "-fno-rtti" ] defines = [ "_GNU_SOURCE", "OHOS_ARCH_LITE", ] if (dhcp_hilog_enable) { deps += [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ] defines += [ "DHCP_HILOG_ENABLE" ] } } } else { local_base_sources = [ "src/address_utils.cpp", "src/common_util.cpp", "src/dhcp_address_pool.cpp", "src/dhcp_argument.cpp", "src/dhcp_binding.cpp", "src/dhcp_config.cpp", "src/dhcp_dhcpd.cpp", "src/dhcp_function.cpp", "src/dhcp_option.cpp", "src/dhcp_s_server.cpp", "src/dhcp_server_death_recipient.cpp", "src/dhcp_server_service_impl.cpp", ] config("dhcp_manager_service_header") { visibility = [ ":*" ] include_dirs = local_base_include_dirs } ohos_shared_library("dhcp_server") { branch_protector_ret = "pac_ret" sanitize = { cfi = true boundary_sanitize = true cfi_cross_dso = true debug = false } install_enable = true sources = local_base_sources sources += [ "src/dhcp_server_callback_proxy.cpp", "src/dhcp_server_stub.cpp", ] include_dirs = local_base_include_dirs deps = [ "$DHCP_ROOT_DIR/services/utils:dhcp_utils" ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] cflags = [ "-std=c++17", "-fno-rtti", ] ldflags = [ "-fPIC", "-Wl,-E", ] shlib_type = "sa" version_script = "libdhcp_server.map" public_configs = [ ":dhcp_manager_service_header" ] part_name = "dhcp" subsystem_name = "communication" innerapi_tags = [ "platformsdk" ] } }