blob: 47b0380704c5476643752887999b6556a9ffac7d [file] [log] [blame]
Liam McLoughlin4f268f42013-03-04 18:09:53 -05001{
2 'target_defaults': {
3 'variables': {
4 'deps': [
5 'libchrome-<(libbase_ver)'
6 ],
Alex Deymo94afaa42015-11-16 16:34:39 -03007 'USE_dbus%': '1',
Liam McLoughlin4f268f42013-03-04 18:09:53 -05008 },
9 'include_dirs': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -070010 '../libbrillo',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050011 ],
Alex Deymo94afaa42015-11-16 16:34:39 -030012 'defines': [
13 'USE_DBUS=<(USE_dbus)',
Alex Deymof68e8982016-01-05 21:20:10 -080014 'USE_RTTI_FOR_TYPE_TAGS',
Alex Deymo94afaa42015-11-16 16:34:39 -030015 ],
Liam McLoughlin4f268f42013-03-04 18:09:53 -050016 },
17 'targets': [
18 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -070019 'target_name': 'libbrillo-<(libbase_ver)',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050020 'type': 'none',
21 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -070022 'libbrillo-core-<(libbase_ver)',
23 'libbrillo-cryptohome-<(libbase_ver)',
24 'libbrillo-http-<(libbase_ver)',
25 'libbrillo-minijail-<(libbase_ver)',
26 'libbrillo-streams-<(libbase_ver)',
Thiemo Nagelce533da2016-10-24 14:53:14 +020027 'libinstallattributes-<(libbase_ver)',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050028 'libpolicy-<(libbase_ver)',
29 ],
30 'direct_dependent_settings': {
31 'include_dirs': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -070032 '../libbrillo',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050033 ],
34 },
Bertrand SIMONNET883c3e72014-06-04 13:22:47 -070035 'includes': ['../common-mk/deps.gypi'],
Liam McLoughlin4f268f42013-03-04 18:09:53 -050036 },
37 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -070038 'target_name': 'libbrillo-core-<(libbase_ver)',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050039 'type': 'shared_library',
40 'variables': {
41 'exported_deps': [
42 'dbus-1',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050043 ],
44 'deps': ['<@(exported_deps)'],
45 },
46 'all_dependent_settings': {
47 'variables': {
48 'deps': [
49 '<@(exported_deps)',
50 ],
51 },
52 },
Bertrand SIMONNETf6ec4fc2015-07-15 14:14:19 -070053 'libraries': ['-lmodp_b64'],
Alex Deymo94afaa42015-11-16 16:34:39 -030054 #TODO(deymo): Split DBus code from libbrillo-core the same way is split in
55 # the Android.mk, based on the <(USE_dbus) variable.
Liam McLoughlin4f268f42013-03-04 18:09:53 -050056 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -070057 'brillo/any.cc',
58 'brillo/asynchronous_signal_handler.cc',
59 'brillo/backoff_entry.cc',
60 'brillo/daemons/dbus_daemon.cc',
61 'brillo/daemons/daemon.cc',
62 'brillo/data_encoding.cc',
63 'brillo/dbus/async_event_sequencer.cc',
64 'brillo/dbus/data_serialization.cc',
Alex Deymo2a251902016-01-20 17:04:51 -080065 'brillo/dbus/dbus_connection.cc',
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -070066 'brillo/dbus/dbus_method_invoker.cc',
67 'brillo/dbus/dbus_method_response.cc',
68 'brillo/dbus/dbus_object.cc',
69 'brillo/dbus/dbus_service_watcher.cc',
70 'brillo/dbus/dbus_signal.cc',
71 'brillo/dbus/exported_object_manager.cc',
72 'brillo/dbus/exported_property_set.cc',
73 'brillo/dbus/utils.cc',
74 'brillo/errors/error.cc',
75 'brillo/errors/error_codes.cc',
76 'brillo/file_utils.cc',
77 'brillo/flag_helper.cc',
78 'brillo/key_value_store.cc',
79 'brillo/message_loops/base_message_loop.cc',
80 'brillo/message_loops/message_loop.cc',
81 'brillo/message_loops/message_loop_utils.cc',
82 'brillo/mime_utils.cc',
83 'brillo/osrelease_reader.cc',
84 'brillo/process.cc',
85 'brillo/process_reaper.cc',
86 'brillo/process_information.cc',
87 'brillo/secure_blob.cc',
88 'brillo/strings/string_utils.cc',
89 'brillo/syslog_logging.cc',
90 'brillo/type_name_undecorate.cc',
91 'brillo/url_utils.cc',
92 'brillo/userdb_utils.cc',
Alex Vakulenkob57ecfa2016-01-28 14:41:20 -080093 'brillo/value_conversion.cc',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050094 ],
95 },
96 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -070097 'target_name': 'libbrillo-http-<(libbase_ver)',
Alex Vakulenkof788c952014-08-20 17:35:12 -070098 'type': 'shared_library',
Alex Vakulenko80663bf2015-03-12 17:30:11 -070099 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700100 'libbrillo-core-<(libbase_ver)',
101 'libbrillo-streams-<(libbase_ver)',
Alex Vakulenko80663bf2015-03-12 17:30:11 -0700102 ],
Alex Vakulenkof788c952014-08-20 17:35:12 -0700103 'variables': {
104 'exported_deps': [
105 'libcurl',
106 ],
107 'deps': ['<@(exported_deps)'],
108 },
109 'all_dependent_settings': {
110 'variables': {
111 'deps': [
112 '<@(exported_deps)',
113 ],
114 },
115 },
Alex Vakulenkof788c952014-08-20 17:35:12 -0700116 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700117 'brillo/http/curl_api.cc',
118 'brillo/http/http_connection_curl.cc',
119 'brillo/http/http_form_data.cc',
120 'brillo/http/http_request.cc',
121 'brillo/http/http_transport.cc',
122 'brillo/http/http_transport_curl.cc',
123 'brillo/http/http_utils.cc',
Alex Vakulenkof788c952014-08-20 17:35:12 -0700124 ],
125 },
126 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700127 'target_name': 'libbrillo-streams-<(libbase_ver)',
Alex Vakulenko1e582b32015-02-26 15:23:23 -0800128 'type': 'shared_library',
129 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700130 'libbrillo-core-<(libbase_ver)',
Alex Vakulenko1e582b32015-02-26 15:23:23 -0800131 ],
Alex Vakulenko7554ede2015-05-06 14:52:50 -0700132 'variables': {
133 'exported_deps': [
134 'openssl',
135 ],
136 'deps': ['<@(exported_deps)'],
137 },
138 'all_dependent_settings': {
139 'variables': {
140 'deps': [
141 '<@(exported_deps)',
142 ],
143 },
144 },
Alex Vakulenko1e582b32015-02-26 15:23:23 -0800145 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700146 'brillo/streams/file_stream.cc',
147 'brillo/streams/input_stream_set.cc',
148 'brillo/streams/memory_containers.cc',
149 'brillo/streams/memory_stream.cc',
150 'brillo/streams/openssl_stream_bio.cc',
151 'brillo/streams/stream.cc',
152 'brillo/streams/stream_errors.cc',
153 'brillo/streams/stream_utils.cc',
154 'brillo/streams/tls_stream.cc',
Alex Vakulenko1e582b32015-02-26 15:23:23 -0800155 ],
156 },
157 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700158 'target_name': 'libbrillo-test-<(libbase_ver)',
Alex Vakulenkof788c952014-08-20 17:35:12 -0700159 'type': 'static_library',
160 'standalone_static_library': 1,
161 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700162 'libbrillo-http-<(libbase_ver)',
Alex Vakulenkof788c952014-08-20 17:35:12 -0700163 ],
164 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700165 'brillo/http/http_connection_fake.cc',
166 'brillo/http/http_transport_fake.cc',
167 'brillo/message_loops/fake_message_loop.cc',
168 'brillo/streams/fake_stream.cc',
Alex Deymo37827b62016-03-29 15:56:29 -0700169 'brillo/unittest_utils.cc',
Alex Vakulenkof788c952014-08-20 17:35:12 -0700170 ],
171 'includes': ['../common-mk/deps.gypi'],
172 },
173 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700174 'target_name': 'libbrillo-cryptohome-<(libbase_ver)',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500175 'type': 'shared_library',
176 'variables': {
Daniel Erat15859412014-06-10 11:19:08 -0700177 'exported_deps': [
Daniel Erat15859412014-06-10 11:19:08 -0700178 'openssl',
179 ],
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500180 'deps': ['<@(exported_deps)'],
181 },
182 'all_dependent_settings': {
183 'variables': {
184 'deps': [
185 '<@(exported_deps)',
186 ],
187 },
188 },
189 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700190 'brillo/cryptohome.cc',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500191 ],
192 },
193 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700194 'target_name': 'libbrillo-minijail-<(libbase_ver)',
Utkarsh Sanghid60f9ae2014-07-29 16:01:43 -0700195 'type': 'shared_library',
Bertrand SIMONNETd6143792015-08-13 14:27:05 -0700196 'variables': {
Bertrand SIMONNET92d2ceb2015-08-14 10:19:52 -0700197 'exported_deps': [
Bertrand SIMONNETd6143792015-08-13 14:27:05 -0700198 'libminijail',
199 ],
Bertrand SIMONNET92d2ceb2015-08-14 10:19:52 -0700200 'deps': ['<@(exported_deps)'],
201 },
202 'all_dependent_settings': {
203 'variables': {
204 'deps': [
205 '<@(exported_deps)',
206 ],
207 },
Bertrand SIMONNETd6143792015-08-13 14:27:05 -0700208 },
Utkarsh Sanghid60f9ae2014-07-29 16:01:43 -0700209 'cflags': [
210 '-fvisibility=default',
211 ],
212 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700213 'brillo/minijail/minijail.cc',
Utkarsh Sanghid60f9ae2014-07-29 16:01:43 -0700214 ],
215 },
216 {
Thiemo Nagelce533da2016-10-24 14:53:14 +0200217 'target_name': 'libinstallattributes-<(libbase_ver)',
218 'type': 'shared_library',
219 'dependencies': [
220 'libinstallattributes-includes',
221 '../common-mk/external_dependencies.gyp:install_attributes-proto',
222 ],
223 'variables': {
224 'exported_deps': [
225 'protobuf-lite',
226 ],
227 'deps': ['<@(exported_deps)'],
228 },
229 'all_dependent_settings': {
230 'variables': {
231 'deps': [
232 '<@(exported_deps)',
233 ],
234 },
235 },
236 'sources': [
237 'install_attributes/libinstallattributes.cc',
238 ],
239 },
240 {
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500241 'target_name': 'libpolicy-<(libbase_ver)',
242 'type': 'shared_library',
Chris Masone242ab242013-11-13 13:26:52 -0800243 'dependencies': [
Thiemo Nagelce533da2016-10-24 14:53:14 +0200244 'libinstallattributes-<(libbase_ver)',
Bertrand SIMONNET883c3e72014-06-04 13:22:47 -0700245 'libpolicy-includes',
246 '../common-mk/external_dependencies.gyp:policy-protos',
Chris Masone242ab242013-11-13 13:26:52 -0800247 ],
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500248 'variables': {
249 'exported_deps': [
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500250 'openssl',
251 'protobuf-lite',
252 ],
253 'deps': ['<@(exported_deps)'],
254 },
255 'all_dependent_settings': {
256 'variables': {
257 'deps': [
258 '<@(exported_deps)',
259 ],
260 },
261 },
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500262 'ldflags': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700263 '-Wl,--version-script,<(platform2_root)/libbrillo/libpolicy.ver',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500264 ],
265 'sources': [
Alex Deymo3c8d4ab2015-09-02 17:15:00 -0700266 'policy/device_policy.cc',
267 'policy/device_policy_impl.cc',
268 'policy/libpolicy.cc',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500269 ],
270 },
Bertrand SIMONNET211054c2014-06-24 16:33:32 -0700271 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700272 'target_name': 'libbrillo-glib-<(libbase_ver)',
Christopher Wiley8065d312015-07-08 13:11:21 -0700273 'type': 'shared_library',
274 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700275 'libbrillo-<(libbase_ver)',
Christopher Wiley8065d312015-07-08 13:11:21 -0700276 ],
277 'variables': {
278 'exported_deps': [
279 'dbus-1',
280 'dbus-glib-1',
281 'glib-2.0',
282 'gobject-2.0',
283 ],
284 'deps': ['<@(exported_deps)'],
285 },
286 'cflags': [
287 # glib uses the deprecated "register" attribute in some header files.
288 '-Wno-deprecated-register',
289 ],
290 'all_dependent_settings': {
291 'variables': {
292 'deps': [
293 '<@(exported_deps)',
294 ],
295 },
296 },
297 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700298 'brillo/glib/abstract_dbus_service.cc',
299 'brillo/glib/dbus.cc',
300 'brillo/message_loops/glib_message_loop.cc',
Christopher Wiley8065d312015-07-08 13:11:21 -0700301 ],
302 'includes': ['../common-mk/deps.gypi'],
303 },
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500304 ],
305 'conditions': [
306 ['USE_test == 1', {
307 'targets': [
308 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700309 'target_name': 'libbrillo-<(libbase_ver)_unittests',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500310 'type': 'executable',
Daniel Erat8a6c5902014-06-04 13:50:01 -0700311 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700312 'libbrillo-<(libbase_ver)',
313 'libbrillo-test-<(libbase_ver)',
314 'libbrillo-glib-<(libbase_ver)',
Daniel Erat8a6c5902014-06-04 13:50:01 -0700315 ],
Christopher Wileya96e6db2014-08-07 15:47:24 -0700316 'variables': {
317 'deps': [
318 'libchrome-test-<(libbase_ver)',
319 ],
Alex Vakulenkob2135452015-10-19 11:23:51 -0700320 'proto_in_dir': 'brillo/dbus',
Alex Vakulenko2df11632015-10-23 13:43:05 -0700321 'proto_out_dir': 'include/brillo/dbus',
Christopher Wileya96e6db2014-08-07 15:47:24 -0700322 },
Alex Vakulenkod0b4d8d2015-03-31 19:33:31 -0700323 'includes': [
324 '../common-mk/common_test.gypi',
325 '../common-mk/protoc.gypi',
326 ],
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500327 'cflags': [
328 '-Wno-format-zero-length',
329 ],
330 'conditions': [
331 ['debug == 1', {
332 'cflags': [
333 '-fprofile-arcs',
334 '-ftest-coverage',
335 '-fno-inline',
336 ],
337 'libraries': [
338 '-lgcov',
339 ],
340 }],
341 ],
342 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700343 'brillo/any_unittest.cc',
344 'brillo/any_internal_impl_unittest.cc',
345 'brillo/asynchronous_signal_handler_unittest.cc',
346 'brillo/backoff_entry_unittest.cc',
347 'brillo/data_encoding_unittest.cc',
348 'brillo/dbus/async_event_sequencer_unittest.cc',
349 'brillo/dbus/data_serialization_unittest.cc',
350 'brillo/dbus/dbus_method_invoker_unittest.cc',
351 'brillo/dbus/dbus_object_unittest.cc',
352 'brillo/dbus/dbus_param_reader_unittest.cc',
353 'brillo/dbus/dbus_param_writer_unittest.cc',
354 'brillo/dbus/dbus_signal_handler_unittest.cc',
355 'brillo/dbus/exported_object_manager_unittest.cc',
356 'brillo/dbus/exported_property_set_unittest.cc',
357 'brillo/errors/error_codes_unittest.cc',
358 'brillo/errors/error_unittest.cc',
359 'brillo/file_utils_unittest.cc',
360 'brillo/flag_helper_unittest.cc',
361 'brillo/glib/object_unittest.cc',
362 'brillo/http/http_connection_curl_unittest.cc',
363 'brillo/http/http_form_data_unittest.cc',
364 'brillo/http/http_request_unittest.cc',
365 'brillo/http/http_transport_curl_unittest.cc',
366 'brillo/http/http_utils_unittest.cc',
367 'brillo/key_value_store_unittest.cc',
368 'brillo/map_utils_unittest.cc',
Alex Deymod6717462016-01-14 10:50:16 -0800369 'brillo/message_loops/base_message_loop_unittest.cc',
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700370 'brillo/message_loops/fake_message_loop_unittest.cc',
371 'brillo/message_loops/glib_message_loop_unittest.cc',
372 'brillo/message_loops/message_loop_unittest.cc',
373 'brillo/mime_utils_unittest.cc',
374 'brillo/osrelease_reader_unittest.cc',
375 'brillo/process_reaper_unittest.cc',
376 'brillo/process_unittest.cc',
377 'brillo/secure_blob_unittest.cc',
378 'brillo/streams/fake_stream_unittest.cc',
379 'brillo/streams/file_stream_unittest.cc',
380 'brillo/streams/input_stream_set_unittest.cc',
381 'brillo/streams/memory_containers_unittest.cc',
382 'brillo/streams/memory_stream_unittest.cc',
383 'brillo/streams/openssl_stream_bio_unittests.cc',
384 'brillo/streams/stream_unittest.cc',
385 'brillo/streams/stream_utils_unittest.cc',
386 'brillo/strings/string_utils_unittest.cc',
Alex Vakulenko4d8501c2015-12-21 12:05:41 -0800387 'brillo/type_name_undecorate_unittest.cc',
Alex Deymo992e4292015-12-11 19:42:09 -0800388 'brillo/unittest_utils.cc',
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700389 'brillo/url_utils_unittest.cc',
390 'brillo/variant_dictionary_unittest.cc',
Alex Vakulenkob57ecfa2016-01-28 14:41:20 -0800391 'brillo/value_conversion_unittest.cc',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500392 'testrunner.cc',
Alex Vakulenkod0b4d8d2015-03-31 19:33:31 -0700393 '<(proto_in_dir)/test.proto',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500394 ]
395 },
396 {
Thiemo Nagelce533da2016-10-24 14:53:14 +0200397 'target_name': 'libinstallattributes-<(libbase_ver)_unittests',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500398 'type': 'executable',
Thiemo Nagelce533da2016-10-24 14:53:14 +0200399 'dependencies': [
400 '../common-mk/external_dependencies.gyp:install_attributes-proto',
401 'libinstallattributes-<(libbase_ver)',
402 ],
Bertrand SIMONNET883c3e72014-06-04 13:22:47 -0700403 'includes': ['../common-mk/common_test.gypi'],
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500404 'sources': [
Thiemo Nagelce533da2016-10-24 14:53:14 +0200405 'install_attributes/tests/libinstallattributes_unittest.cc',
406 ]
407 },
408 {
409 'target_name': 'libpolicy-<(libbase_ver)_unittests',
410 'type': 'executable',
411 'dependencies': [
412 '../common-mk/external_dependencies.gyp:install_attributes-proto',
413 'libinstallattributes-<(libbase_ver)',
414 'libpolicy-<(libbase_ver)',
415 ],
416 'includes': ['../common-mk/common_test.gypi'],
417 'sources': [
418 'install_attributes/mock_install_attributes_reader.cc',
Alex Deymo3c8d4ab2015-09-02 17:15:00 -0700419 'policy/tests/libpolicy_unittest.cc',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500420 ]
421 },
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500422 ],
423 }],
424 ],
425}