1 # 2 # Copyright (C) 2015 The Android Open Source Project 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 # 16 17 { 18 'target_defaults': { 19 'variables': { 20 'deps': [ 21 'libbrillo-<(libbase_ver)', 22 'libchrome-<(libbase_ver)', 23 ], 24 }, 25 'cflags': [ 26 '-Wextra', 27 '-Wno-unused-parameter', # base/lazy_instance.h, etc. 28 ], 29 'cflags_cc': [ 30 '-Wno-missing-field-initializers', # for LAZY_INSTANCE_INITIALIZER 31 ], 32 'include_dirs': [ 33 # We need this include dir because we include all the local code as 34 # "apmanager/...". 35 '<(platform2_root)/../aosp/system/connectivity', 36 ], 37 }, 38 'targets': [ 39 { 40 'target_name': 'apmanager-adaptors', 41 'type': 'none', 42 'variables': { 43 'dbus_adaptors_out_dir': 'include/dbus_bindings', 44 'dbus_xml_extension': 'dbus-xml', 45 }, 46 'sources': [ 47 'dbus_bindings/org.chromium.apmanager.Config.dbus-xml', 48 'dbus_bindings/org.chromium.apmanager.Device.dbus-xml', 49 'dbus_bindings/org.chromium.apmanager.Manager.dbus-xml', 50 'dbus_bindings/org.chromium.apmanager.Service.dbus-xml', 51 ], 52 'includes': ['../../../../platform2/common-mk/generate-dbus-adaptors.gypi'], 53 }, 54 { 55 'target_name': 'libapmanager', 56 'type': 'static_library', 57 'dependencies': [ 58 'apmanager-adaptors', 59 ], 60 'variables': { 61 'exported_deps': [ 62 'libpermission_broker-client', 63 'libshill-client', 64 'libshill-net-<(libbase_ver)', 65 ], 66 'deps': ['<@(exported_deps)'], 67 }, 68 'all_dependent_settings': { 69 'variables': { 70 'deps': [ 71 '<@(exported_deps)', 72 ], 73 }, 74 }, 75 'sources': [ 76 'config.cc', 77 'daemon.cc', 78 'dbus/config_dbus_adaptor.cc', 79 'dbus/dbus_control.cc', 80 'dbus/device_dbus_adaptor.cc', 81 'dbus/manager_dbus_adaptor.cc', 82 'dbus/permission_broker_dbus_proxy.cc', 83 'dbus/service_dbus_adaptor.cc', 84 'dbus/shill_dbus_proxy.cc', 85 'device.cc', 86 'device_info.cc', 87 'dhcp_server.cc', 88 'dhcp_server_factory.cc', 89 'error.cc', 90 'event_dispatcher.cc', 91 'file_writer.cc', 92 'firewall_manager.cc', 93 'hostapd_monitor.cc', 94 'manager.cc', 95 'process_factory.cc', 96 'service.cc', 97 'shill_manager.cc', 98 ], 99 }, 100 { 101 'target_name': 'apmanager', 102 'type': 'executable', 103 'dependencies': ['libapmanager'], 104 'variables': { 105 'deps': [ 106 'libminijail', 107 ], 108 }, 109 'sources': [ 110 'main.cc', 111 ], 112 }, 113 # apmanager client library generated headers. Used by other daemons to 114 # interact with apmanager. 115 { 116 'target_name': 'libapmanager-client-headers', 117 'type': 'none', 118 'actions': [ 119 { 120 'action_name': 'libapmanager-client-dbus-proxies', 121 'variables': { 122 'dbus_service_config': 'dbus_bindings/dbus-service-config.json', 123 'proxy_output_file': 'include/apmanager/dbus-proxies.h', 124 'mock_output_file': 'include/apmanager/dbus-proxy-mocks.h', 125 'proxy_path_in_mocks': 'apmanager/dbus-proxies.h', 126 }, 127 'sources': [ 128 'dbus_bindings/org.chromium.apmanager.Config.dbus-xml', 129 'dbus_bindings/org.chromium.apmanager.Device.dbus-xml', 130 'dbus_bindings/org.chromium.apmanager.Manager.dbus-xml', 131 'dbus_bindings/org.chromium.apmanager.Service.dbus-xml', 132 ], 133 'includes': ['../../../../platform2/common-mk/generate-dbus-proxies.gypi'], 134 }, 135 ] 136 }, 137 ], 138 'conditions': [ 139 ['USE_test == 1', { 140 'targets': [ 141 { 142 'target_name': 'apmanager_testrunner', 143 'type': 'executable', 144 'dependencies': ['libapmanager'], 145 'includes': ['../../../../platform2/common-mk/common_test.gypi'], 146 'sources': [ 147 'config_unittest.cc', 148 'device_info_unittest.cc', 149 'device_unittest.cc', 150 'dhcp_server_unittest.cc', 151 'error_unittest.cc', 152 'fake_config_adaptor.cc', 153 'fake_device_adaptor.cc', 154 'hostapd_monitor_unittest.cc', 155 'manager_unittest.cc', 156 'mock_config.cc', 157 'mock_control.cc', 158 'mock_device.cc', 159 'mock_dhcp_server.cc', 160 'mock_dhcp_server_factory.cc', 161 'mock_event_dispatcher.cc', 162 'mock_file_writer.cc', 163 'mock_hostapd_monitor.cc', 164 'mock_manager.cc', 165 'mock_process_factory.cc', 166 'mock_service.cc', 167 'mock_service_adaptor.cc', 168 'service_unittest.cc', 169 'testrunner.cc', 170 ], 171 }, 172 ], 173 }], 174 ], 175 } 176