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
14# args of this module
15SUBSYSTEM_DIR = "//foundation/communication"
16NETMANAGER_EXT_ROOT = "$SUBSYSTEM_DIR/netmanager_ext"
17
18# args of frameworks
19FRAMEWORKS_SRC = "$NETMANAGER_EXT_ROOT/frameworks/native/externalvpnclient/src"
20ETHERNETMANAGER_INNERKITS_SOURCE_DIR =
21    "$NETMANAGER_EXT_ROOT/frameworks/native/ethernetclient"
22NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR =
23    "$NETMANAGER_EXT_ROOT/frameworks/native/netshareclient"
24VPN_INNERKITS_SOURCE_DIR = "$NETMANAGER_EXT_ROOT/frameworks/native/netvpnclient"
25VPN_EXTENSION_SOURCE_DIR = "$NETMANAGER_EXT_ROOT/frameworks/native/vpnextension"
26NETFIREWALL_EXTENSION_SOURCE_DIR =
27    "$NETMANAGER_EXT_ROOT/frameworks/native/netfirewallclient"
28
29# args of interfaces
30INTERFACES_INCLUDE =
31    "$NETMANAGER_EXT_ROOT/interfaces/innerkits/externalvpnclient/include"
32INTERFACES_DIR = "$NETMANAGER_EXT_ROOT/interfaces/innerkits/externalvpnclient"
33EXT_INNERKITS_ROOT = "$NETMANAGER_EXT_ROOT/interfaces/innerkits"
34MDNSINTERFACE_INCLUDE = "$NETMANAGER_EXT_ROOT/interfaces/innerkits/mdnsclient"
35
36# args of services
37SERVICES_EXTERNALVPNMANAGER = "$NETMANAGER_EXT_ROOT/services/externalvpnmanager"
38ETHERNETMANAGER_SOURCE_DIR = "$NETMANAGER_EXT_ROOT/services/ethernetmanager"
39NETWORKSHAREMANAGER_SOURCE_DIR =
40    "$NETMANAGER_EXT_ROOT/services/networksharemanager"
41MDNSMANAGER_SOURCE_DIR = "$NETMANAGER_EXT_ROOT/services/mdnsmanager"
42VPNMANAGER_SOURCE_DIR = "$NETMANAGER_EXT_ROOT/services/vpnmanager"
43NETFIREWALLMANAGER_SOURCE_DIR =
44    "$NETMANAGER_EXT_ROOT/services/netfirewallmanager"
45
46# args of uitls
47NETWORKSHAREMANAGER_UTILS_DIR = "$NETMANAGER_EXT_ROOT/utils"
48
49# args of base module
50NETMANAGER_BASE_ROOT = "$SUBSYSTEM_DIR/netmanager_base"
51
52# args of base modules'frameworks
53NETCONNMANAGER_INNERKITS_SOURCE_DIR =
54    "$NETMANAGER_BASE_ROOT/frameworks/native/netconnclient"
55
56# args of base modules' interfaces
57BASE_INNERKITS_ROOT = "$NETMANAGER_BASE_ROOT/interfaces/innerkits"
58
59# args of base module's servicesability_runtime
60NETCONNMANAGER_COMMON_DIR = "$NETMANAGER_BASE_ROOT/services/common"
61NETSYSCONTROLLER_ROOT_DIR = "$NETMANAGER_BASE_ROOT/services/netsyscontroller"
62NETCONNMANAGER_SOURCE_DIR = "$NETMANAGER_BASE_ROOT/services/netconnmanager"
63NETMANAGERNATIVE_ROOT = "$NETMANAGER_BASE_ROOT/services/netmanagernative"
64
65# args of base module's utils
66NETCONNMANAGER_UTILS_DIR = "$NETMANAGER_BASE_ROOT/utils"
67
68# NETMANAGER_PREBUILTS_DIR = "$NETMANAGER_BASE_ROOT/prebuilts"
69
70# args of other module
71DHCP_MANAGER_ROOT = "//foundation/communication/dhcp"
72WIFI_MANAGER_ROOT = "//foundation/communication/wifi/wifi"
73WIFI_MANAGER_INNERKITS_DIR = "$WIFI_MANAGER_ROOT/interfaces/kits/c"
74WIFI_FRAMEWORK_NATIVE_INCLUDE = "$WIFI_MANAGER_ROOT/frameworks/native/include"
75BLUETOOTH_ROOT = "//foundation/communication/bluetooth"
76USB_MANAGER_ROOT = "//base/usb/usb_manager"
77SAMGR_MANAGER_ROOT = "//foundation/systemabilitymgr/samgr"
78UTILS_ROOT = "//utils"
79THIRD_PARTY_ROOT = "//third_party"
80C_UTILS_ROOT = "//commonlibrary/c_utils"
81ABILITY_RUNTIME_PATH = "//foundation/ability/ability_runtime"
82ABILITY_RUNTIME_INNER_API_PATH = "$ABILITY_RUNTIME_PATH/interfaces/inner_api"
83ABILITY_RUNTIME_KITS_PATH = "$ABILITY_RUNTIME_PATH/interfaces/kits"
84ABILITY_RUNTIME_SERVICES_PATH = "$ABILITY_RUNTIME_PATH/services"
85ABILITY_RUNTIME_NAPI_PATH = "$ABILITY_RUNTIME_PATH/frameworks/js/napi"
86ABILITY_RUNTIME_NATIVE_PATH = "$ABILITY_RUNTIME_PATH/frameworks/native"
87ABILITY_DISPLAY_MANAGER = "//foundation/window/window_manager"
88
89use_js_debug = false
90declare_args() {
91  communication_bluetooth_switch_enable = false
92  communication_wifi_switch_enable = false
93  enable_netmgr_ext_debug = true
94  netmanager_ext_feature_coverage = false
95  netmanager_ext_feature_ethernet = true
96  netmanager_ext_feature_share = true
97  netmanager_ext_feature_mdns = true
98  netmanager_ext_feature_net_firewall = false
99  netmanager_ext_feature_vpn = true
100  netmanager_ext_feature_vpnext = true
101  usb_manager_enable = false
102}
103
104memory_optimization_cflags = [
105  "-fvisibility=hidden",
106  "-fdata-sections",
107  "-ffunction-sections",
108  "-Os",
109]
110
111memory_optimization_cflags_cc = [
112  "-fvisibility-inlines-hidden",
113  "-Os",
114]
115
116memory_optimization_ldflags = [
117  "-Wl,--exclude-libs=ALL",
118  "-Wl,--gc-sections",
119]
120
121if (defined(global_parts_info) &&
122    defined(global_parts_info.communication_wifi) &&
123    global_parts_info.communication_wifi) {
124  communication_wifi_switch_enable = true
125}
126
127if (defined(global_parts_info) &&
128    defined(global_parts_info.communication_bluetooth) &&
129    global_parts_info.communication_bluetooth) {
130  communication_bluetooth_switch_enable = false
131}
132
133if (defined(global_parts_info) && defined(global_parts_info.usb_usb_manager) &&
134    global_parts_info.usb_usb_manager) {
135  usb_manager_enable = true
136}
137
138fuzz_test_path = "netmanager_ext/netmanager_ext"
139