blob: bb5bea66bc9a8740ea1c8e6726e391c41ab5a59d [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',
Alex Vakulenkoc16c6da2015-02-25 14:35:55 -080099 'webservd/log_manager.cc',
Gilad Arnolde14a6182015-08-13 12:01:00 -0700100 'webservd/permission_broker_firewall.cc',
Alex Vakulenko31a63792015-02-03 12:44:57 -0800101 'webservd/protocol_handler.cc',
102 'webservd/request.cc',
103 'webservd/server.cc',
104 'webservd/utils.cc',
Alex Vakulenko039da312015-02-03 08:58:55 -0800105 ],
106 'includes': ['../common-mk/generate-dbus-adaptors.gypi'],
Alex Vakulenko31a63792015-02-03 12:44:57 -0800107 'actions': [
108 {
109 'action_name': 'generate-libwebserv-proxies',
110 'variables': {
111 # Not using dbus_service_config here deliberately in order not to
112 # get tied to some constant service name, since it will be
113 # provided by the consumer of libwebserv library.
114 'dbus_service_config': '',
115 'mock_output_file': 'include/libwebserv/dbus-mocks.h',
116 'proxy_output_file': 'include/libwebserv/dbus-proxies.h',
117 },
118 'sources': [
Alex Vakulenkoe1a8ca42015-09-11 09:32:18 -0700119 'libwebserv/dbus_bindings/org.chromium.WebServer.RequestHandler.dbus-xml',
Alex Vakulenko31a63792015-02-03 12:44:57 -0800120 ],
121 'includes': ['../common-mk/generate-dbus-proxies.gypi'],
122 },
123 ],
Alex Vakulenko039da312015-02-03 08:58:55 -0800124 },
Alex Vakulenko664af902015-02-11 15:33:12 -0800125 {
126 'target_name': 'libwebserv-<(libbase_ver)',
127 'type': 'shared_library',
128 'includes': [
129 '../common-mk/deps.gypi',
130 ],
131 'dependencies': [
132 'libwebserv_common',
133 ],
134 'sources': [
135 'libwebserv/_empty.cc',
136 ],
137 },
138 {
139 'target_name': 'webservd',
140 'type': 'executable',
141 'dependencies': [
142 'webservd_common',
143 ],
Bertrand SIMONNETcb3bc272015-08-13 14:27:05 -0700144 'variables': {
145 'deps': [
146 'libminijail',
Alex Vakulenko664af902015-02-11 15:33:12 -0800147 ],
148 },
149 'sources': [
150 'webservd/main.cc',
151 ],
152 },
Alex Vakulenko039da312015-02-03 08:58:55 -0800153 ],
154 'conditions': [
155 ['USE_test == 1', {
156 'targets': [
157 {
158 'target_name': 'libwebserv_testrunner',
159 'type': 'executable',
160 'dependencies': [
Alex Vakulenko664af902015-02-11 15:33:12 -0800161 'libwebserv_common',
Alex Vakulenko039da312015-02-03 08:58:55 -0800162 ],
163 'includes': ['../common-mk/common_test.gypi'],
164 'sources': [
165 'libwebserv/libwebserv_testrunner.cc',
166 ],
167 },
Alex Vakulenko664af902015-02-11 15:33:12 -0800168 {
169 'target_name': 'webservd_testrunner',
170 'type': 'executable',
171 'dependencies': [
172 'webservd_common',
173 ],
174 'includes': ['../common-mk/common_test.gypi'],
175 'sources': [
Alex Vakulenko8db2b532015-02-12 07:41:51 -0800176 'webservd/config_unittest.cc',
Alex Vakulenkoc16c6da2015-02-25 14:35:55 -0800177 'webservd/log_manager_unittest.cc',
Alex Vakulenko664af902015-02-11 15:33:12 -0800178 'webservd/webservd_testrunner.cc',
179 ],
180 },
Alex Vakulenko039da312015-02-03 08:58:55 -0800181 ],
182 }],
183 ],
184}