blob: 5a3f95bbc2b2d5db817ca550ded0116db39a6708 [file] [log] [blame]
Alex Vakulenko039da312015-02-03 08:58:55 -08001{
2 'target_defaults': {
3 'variables': {
4 'deps': [
5 'libchrome-<(libbase_ver)',
6 'libchromeos-<(libbase_ver)',
7 ],
8 },
9 'include_dirs': ['.'],
10 },
11 'targets': [
12 {
Alex Vakulenko664af902015-02-11 15:33:12 -080013 'target_name': 'libwebserv_common',
14 'type': 'static_library',
Alex Vakulenko039da312015-02-03 08:58:55 -080015 'variables': {
Alex Vakulenko31a63792015-02-03 12:44:57 -080016 # Not using dbus_service_config here deliberately in order not to
17 # get tied to some constant service name, since it will be
18 # provided by the consumer of libwebserv library.
19 'dbus_service_config': '',
Christopher Wiley34bc9df2015-08-19 15:03:47 -070020 'dbus_adaptors_out_dir': 'include/dbus_bindings',
Alex Vakulenkoe1a8ca42015-09-11 09:32:18 -070021 'dbus_xml_extension': 'dbus-xml',
Alex Vakulenko039da312015-02-03 08:58:55 -080022 },
Alex Vakulenko664af902015-02-11 15:33:12 -080023 # This static library is used in libwebserv shared library, which means
24 # we must generate position-independent code for the files comprising
25 # this library. Since this option is disabled by default for targets
26 # other than 'shared_library', turn it on explicitly for this lib.
27 # Turn off the default -fPIE flag (which is set for static_library
28 # in ../common-mk/common.gypi) and replace it with -fPIC.
29 'cflags!': ['-fPIE'],
30 'cflags': ['-fPIC'],
Alex Vakulenko31a63792015-02-03 12:44:57 -080031 'includes': [
Alex Vakulenko31a63792015-02-03 12:44:57 -080032 '../common-mk/generate-dbus-adaptors.gypi'
33 ],
Alex Vakulenko039da312015-02-03 08:58:55 -080034 'sources': [
Alex Vakulenko31a63792015-02-03 12:44:57 -080035 'libwebserv/protocol_handler.cc',
Alex Vakulenko039da312015-02-03 08:58:55 -080036 'libwebserv/request.cc',
37 'libwebserv/request_handler_callback.cc',
Alex Vakulenko31a63792015-02-03 12:44:57 -080038 'libwebserv/response.cc',
Alex Vakulenko039da312015-02-03 08:58:55 -080039 'libwebserv/server.cc',
Alex Vakulenkoe1a8ca42015-09-11 09:32:18 -070040 'libwebserv/dbus_bindings/org.chromium.WebServer.RequestHandler.dbus-xml',
Alex Vakulenko039da312015-02-03 08:58:55 -080041 ],
42 'actions': [
43 {
44 'action_name': 'generate-webservd-proxies',
45 'variables': {
46 'dbus_service_config': 'webservd/dbus_bindings/dbus-service-config.json',
47 'mock_output_file': 'include/webservd/dbus-mocks.h',
48 'proxy_output_file': 'include/webservd/dbus-proxies.h',
Alex Vakulenko31a63792015-02-03 12:44:57 -080049 'dbus_adaptors_out_dir': '',
Alex Vakulenko039da312015-02-03 08:58:55 -080050 },
51 'sources': [
Alex Vakulenkoe1a8ca42015-09-11 09:32:18 -070052 'webservd/dbus_bindings/org.chromium.WebServer.ProtocolHandler.dbus-xml',
53 'webservd/dbus_bindings/org.chromium.WebServer.Server.dbus-xml',
Alex Vakulenko039da312015-02-03 08:58:55 -080054 ],
55 'includes': ['../common-mk/generate-dbus-proxies.gypi'],
56 },
Alex Vakulenko53131232015-02-13 15:38:12 -080057 {
58 'action_name': 'generate-permission_broker-proxies',
59 'variables': {
60 'dbus_service_config': '<(platform2_root)/permission_broker/dbus_bindings/dbus-service-config.json',
61 'mock_output_file': 'include/permission_broker/dbus-mocks.h',
62 'proxy_output_file': 'include/permission_broker/dbus-proxies.h',
63 'dbus_adaptors_out_dir': '',
64 },
65 'sources': [
66 '<(platform2_root)/permission_broker/dbus_bindings/org.chromium.PermissionBroker.xml',
67 ],
68 'includes': ['../common-mk/generate-dbus-proxies.gypi'],
69 },
Alex Vakulenko039da312015-02-03 08:58:55 -080070 ],
71 },
72 {
Alex Vakulenko664af902015-02-11 15:33:12 -080073 'target_name': 'webservd_common',
74 'type': 'static_library',
Alex Vakulenko039da312015-02-03 08:58:55 -080075 'variables': {
76 'exported_deps': [
77 'libmicrohttpd',
Alex Vakulenko31a63792015-02-03 12:44:57 -080078 'openssl',
Alex Vakulenko039da312015-02-03 08:58:55 -080079 ],
80 'deps': ['<@(exported_deps)'],
Christopher Wiley34bc9df2015-08-19 15:03:47 -070081 'dbus_adaptors_out_dir': 'include/dbus_bindings',
Alex Vakulenko039da312015-02-03 08:58:55 -080082 'dbus_service_config': 'webservd/dbus_bindings/dbus-service-config.json',
Alex Vakulenkoe1a8ca42015-09-11 09:32:18 -070083 'dbus_xml_extension': 'dbus-xml',
Alex Vakulenko039da312015-02-03 08:58:55 -080084 },
Alex Vakulenko664af902015-02-11 15:33:12 -080085 'all_dependent_settings': {
86 'variables': {
87 'deps': [
88 '<@(exported_deps)',
89 ],
90 },
Alex Vakulenko31a63792015-02-03 12:44:57 -080091 },
Alex Vakulenko039da312015-02-03 08:58:55 -080092 'sources': [
Alex Vakulenko8db2b532015-02-12 07:41:51 -080093 'webservd/config.cc',
Alex Vakulenkoe1a8ca42015-09-11 09:32:18 -070094 'webservd/dbus_bindings/org.chromium.WebServer.ProtocolHandler.dbus-xml',
95 'webservd/dbus_bindings/org.chromium.WebServer.Server.dbus-xml',
Alex Vakulenko31a63792015-02-03 12:44:57 -080096 'webservd/dbus_protocol_handler.cc',
97 'webservd/dbus_request_handler.cc',
Alex Vakulenko8db2b532015-02-12 07:41:51 -080098 'webservd/error_codes.cc',
Bertrand SIMONNET4688b462015-09-23 10:55:47 -070099 'webservd/fake_encryptor.cc',
Alex Vakulenkoc16c6da2015-02-25 14:35:55 -0800100 'webservd/log_manager.cc',
Gilad Arnolde14a6182015-08-13 12:01:00 -0700101 'webservd/permission_broker_firewall.cc',
Alex Vakulenko31a63792015-02-03 12:44:57 -0800102 'webservd/protocol_handler.cc',
103 'webservd/request.cc',
104 'webservd/server.cc',
Alex Vakulenko257af622015-09-23 11:20:37 -0700105 'webservd/temp_file_manager.cc',
Alex Vakulenko31a63792015-02-03 12:44:57 -0800106 'webservd/utils.cc',
Alex Vakulenko039da312015-02-03 08:58:55 -0800107 ],
108 'includes': ['../common-mk/generate-dbus-adaptors.gypi'],
Alex Vakulenko31a63792015-02-03 12:44:57 -0800109 'actions': [
110 {
111 'action_name': 'generate-libwebserv-proxies',
112 'variables': {
113 # Not using dbus_service_config here deliberately in order not to
114 # get tied to some constant service name, since it will be
115 # provided by the consumer of libwebserv library.
116 'dbus_service_config': '',
117 'mock_output_file': 'include/libwebserv/dbus-mocks.h',
118 'proxy_output_file': 'include/libwebserv/dbus-proxies.h',
119 },
120 'sources': [
Alex Vakulenkoe1a8ca42015-09-11 09:32:18 -0700121 'libwebserv/dbus_bindings/org.chromium.WebServer.RequestHandler.dbus-xml',
Alex Vakulenko31a63792015-02-03 12:44:57 -0800122 ],
123 'includes': ['../common-mk/generate-dbus-proxies.gypi'],
124 },
125 ],
Alex Vakulenko039da312015-02-03 08:58:55 -0800126 },
Alex Vakulenko664af902015-02-11 15:33:12 -0800127 {
128 'target_name': 'libwebserv-<(libbase_ver)',
129 'type': 'shared_library',
130 'includes': [
131 '../common-mk/deps.gypi',
132 ],
133 'dependencies': [
134 'libwebserv_common',
135 ],
136 'sources': [
137 'libwebserv/_empty.cc',
138 ],
139 },
140 {
141 'target_name': 'webservd',
142 'type': 'executable',
143 'dependencies': [
144 'webservd_common',
145 ],
Bertrand SIMONNETcb3bc272015-08-13 14:27:05 -0700146 'variables': {
147 'deps': [
148 'libminijail',
Alex Vakulenko664af902015-02-11 15:33:12 -0800149 ],
150 },
151 'sources': [
152 'webservd/main.cc',
153 ],
154 },
Alex Vakulenko039da312015-02-03 08:58:55 -0800155 ],
156 'conditions': [
157 ['USE_test == 1', {
158 'targets': [
159 {
160 'target_name': 'libwebserv_testrunner',
161 'type': 'executable',
162 'dependencies': [
Alex Vakulenko664af902015-02-11 15:33:12 -0800163 'libwebserv_common',
Alex Vakulenko039da312015-02-03 08:58:55 -0800164 ],
165 'includes': ['../common-mk/common_test.gypi'],
166 'sources': [
167 'libwebserv/libwebserv_testrunner.cc',
168 ],
169 },
Alex Vakulenko664af902015-02-11 15:33:12 -0800170 {
171 'target_name': 'webservd_testrunner',
172 'type': 'executable',
173 'dependencies': [
174 'webservd_common',
175 ],
176 'includes': ['../common-mk/common_test.gypi'],
177 'sources': [
Alex Vakulenko8db2b532015-02-12 07:41:51 -0800178 'webservd/config_unittest.cc',
Alex Vakulenkoc16c6da2015-02-25 14:35:55 -0800179 'webservd/log_manager_unittest.cc',
Alex Vakulenko664af902015-02-11 15:33:12 -0800180 'webservd/webservd_testrunner.cc',
181 ],
182 },
Alex Vakulenko039da312015-02-03 08:58:55 -0800183 ],
184 }],
185 ],
186}