• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/dhcp/dhcp_lite.gni")
17} else {
18  import("//build/ohos.gni")
19  import("//foundation/communication/dhcp/dhcp.gni")
20}
21
22################################################################################
23
24local_base_sources = [
25  "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_client_service_impl.cpp",
26  "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_event_subscriber.cpp",
27  "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_func.cpp",
28  "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_ipv6_client.cpp",
29  "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_ipv6_event.cpp",
30  "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_server_service.cpp",
31  "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_service.cpp",
32  "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_service_api.cpp",
33]
34
35local_base_include_dirs = [
36  "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_toolkit/log",
37  "$DHCP_ROOT_DIR/services/mgr_service/include",
38  "$DHCP_ROOT_DIR/interfaces/inner_api/interfaces",
39  "$DHCP_ROOT_DIR/interfaces/inner_api/include",
40]
41
42config("dhcp_exported_header_files") {
43  visibility = [ ":*" ]
44  include_dirs = [
45    "$DHCP_ROOT_DIR/interfaces/inner_api/interfaces",
46    "$DHCP_ROOT_DIR/interfaces/inner_api/include",
47  ]
48}
49
50if (defined(ohos_lite)) {
51  shared_library("dhcp_manager_service") {
52    sources = local_base_sources
53
54    include_dirs = local_base_include_dirs
55    include_dirs += [
56      "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
57      "//third_party/bounds_checking_function/include",
58    ]
59
60    deps = [
61      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
62      "//third_party/bounds_checking_function:libsec_shared",
63    ]
64
65    defines = [
66      "_GNU_SOURCE",
67      "OHOS_ARCH_LITE",
68    ]
69    configs -= [ "//build/lite/config:language_cpp" ]
70    cflags_cc = [
71      "-fPIC",
72      "-std=c++17",
73      "-Wall",
74    ]
75    ldflags = [
76      "-fPIC",
77      "-Wl,-E",
78    ]
79  }
80} else {
81  ohos_shared_library("dhcp_manager_service") {
82    sanitize = {
83      cfi = true
84      boundary_sanitize = true
85      cfi_cross_dso = true
86    }
87    install_enable = true
88    sources = local_base_sources
89
90    include_dirs = local_base_include_dirs
91    include_dirs += [
92      "//commonlibrary/c_utils/base/include",
93      "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include",
94    ]
95
96    cflags_cc = [
97      "-std=c++17",
98      "-Wall",
99    ]
100
101    external_deps = [
102      "ability_base:want",
103      "bundle_framework:appexecfwk_base",
104      "c_utils:utils",
105      "common_event_service:cesfwk_innerkits",
106      "eventhandler:libeventhandler",
107      "hilog:libhilog",
108    ]
109    ldflags = [
110      "-fPIC",
111      "-Wl,-E",
112    ]
113
114    part_name = "dhcp"
115    public_configs = [ ":dhcp_exported_header_files" ]
116    subsystem_name = "communication"
117    innerapi_tags = [ "platformsdk" ]
118    version_script = "libdhcp_manager_service.map"
119  }
120
121  ohos_shared_library("dhcp_updater_manager") {
122    sanitize = {
123      cfi = true
124      boundary_sanitize = true
125      cfi_cross_dso = true
126    }
127    install_enable = true
128    sources = local_base_sources
129    symlink_target_name = [ "libdhcp_manager_service.z.so" ]
130    include_dirs = local_base_include_dirs
131    include_dirs += [
132      "//commonlibrary/c_utils/base/include",
133      "//third_party/bounds_checking_function/include",
134    ]
135
136    cflags_cc = [
137      "-std=c++17",
138      "-Wall",
139    ]
140
141    defines = [
142      "OHOS_ARCH_LITE",
143      "OHOS_EUPDATER",
144    ]
145
146    deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
147
148    external_deps = [ "hilog:libhilog" ]
149    ldflags = [
150      "-fPIC",
151      "-Wl,-E",
152    ]
153    install_images = [ "updater" ]
154    part_name = "dhcp"
155    subsystem_name = "communication"
156  }
157}
158