1# Copyright (C) 2021-2022 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14if (defined(ohos_lite)) { 15 import("//build/lite/config/component/lite_component.gni") 16 import("//foundation/communication/wifi/dhcp/dhcp_lite.gni") 17} else { 18 import("//build/ohos.gni") 19 import("//foundation/communication/wifi/dhcp/dhcp.gni") 20} 21 22local_base_sources = [ 23 "src/address_utils.c", 24 "src/common_util.c", 25 "src/dhcp_address_pool.c", 26 "src/dhcp_argument.c", 27 "src/dhcp_binding.c", 28 "src/dhcp_config.c", 29 "src/dhcp_dhcpd.c", 30 "src/dhcp_option.c", 31 "src/dhcp_server.c", 32 "src/hash_table.c", 33] 34 35local_base_include_dirs = [ 36 "include", 37 "include/common", 38 "$DHCP_ROOT_DIR/services/dhcp_client/include", 39] 40 41dhcp_hilog_enable = true 42 43if (defined(ohos_lite)) { 44 executable("dhcp_server") { 45 sources = local_base_sources 46 47 include_dirs = local_base_include_dirs 48 include_dirs += [ 49 "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", 50 "//third_party/bounds_checking_function/include", 51 ] 52 53 deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 54 55 cflags_cc = [ "-fno-rtti" ] 56 57 defines = [ 58 "_GNU_SOURCE", 59 "OHOS_ARCH_LITE", 60 ] 61 if (dhcp_hilog_enable) { 62 deps += [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ] 63 defines += [ "DHCP_HILOG_ENABLE" ] 64 } 65 } 66} else { 67 ohos_executable("dhcp_server") { 68 install_enable = true 69 sources = local_base_sources 70 71 include_dirs = local_base_include_dirs 72 include_dirs += [ "//commonlibrary/c_utils/base/include" ] 73 74 external_deps = [ "c_utils:utils" ] 75 76 cflags_cc = [ "-fno-rtti" ] 77 78 defines = [] 79 if (dhcp_hilog_enable) { 80 external_deps += [ "hiviewdfx_hilog_native:libhilog" ] 81 defines += [ "DHCP_HILOG_ENABLE" ] 82 } 83 84 part_name = "dhcp" 85 subsystem_name = "communication" 86 } 87} 88