blob: 1788775cfb882cb45ef0386d0c09d284d98c6dd2 [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)',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050027 'libpolicy-<(libbase_ver)',
28 ],
29 'direct_dependent_settings': {
30 'include_dirs': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -070031 '../libbrillo',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050032 ],
33 },
Bertrand SIMONNET883c3e72014-06-04 13:22:47 -070034 'includes': ['../common-mk/deps.gypi'],
Liam McLoughlin4f268f42013-03-04 18:09:53 -050035 },
36 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -070037 'target_name': 'libbrillo-core-<(libbase_ver)',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050038 'type': 'shared_library',
39 'variables': {
40 'exported_deps': [
41 'dbus-1',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050042 ],
43 'deps': ['<@(exported_deps)'],
44 },
45 'all_dependent_settings': {
46 'variables': {
47 'deps': [
48 '<@(exported_deps)',
49 ],
50 },
51 },
Bertrand SIMONNETf6ec4fc2015-07-15 14:14:19 -070052 'libraries': ['-lmodp_b64'],
Alex Deymo94afaa42015-11-16 16:34:39 -030053 #TODO(deymo): Split DBus code from libbrillo-core the same way is split in
54 # the Android.mk, based on the <(USE_dbus) variable.
Liam McLoughlin4f268f42013-03-04 18:09:53 -050055 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -070056 'brillo/any.cc',
57 'brillo/asynchronous_signal_handler.cc',
58 'brillo/backoff_entry.cc',
59 'brillo/daemons/dbus_daemon.cc',
60 'brillo/daemons/daemon.cc',
61 'brillo/data_encoding.cc',
62 'brillo/dbus/async_event_sequencer.cc',
63 'brillo/dbus/data_serialization.cc',
Alex Deymo2a251902016-01-20 17:04:51 -080064 'brillo/dbus/dbus_connection.cc',
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -070065 'brillo/dbus/dbus_method_invoker.cc',
66 'brillo/dbus/dbus_method_response.cc',
67 'brillo/dbus/dbus_object.cc',
68 'brillo/dbus/dbus_service_watcher.cc',
69 'brillo/dbus/dbus_signal.cc',
70 'brillo/dbus/exported_object_manager.cc',
71 'brillo/dbus/exported_property_set.cc',
72 'brillo/dbus/utils.cc',
73 'brillo/errors/error.cc',
74 'brillo/errors/error_codes.cc',
75 'brillo/file_utils.cc',
76 'brillo/flag_helper.cc',
77 'brillo/key_value_store.cc',
78 'brillo/message_loops/base_message_loop.cc',
79 'brillo/message_loops/message_loop.cc',
80 'brillo/message_loops/message_loop_utils.cc',
81 'brillo/mime_utils.cc',
82 'brillo/osrelease_reader.cc',
83 'brillo/process.cc',
84 'brillo/process_reaper.cc',
85 'brillo/process_information.cc',
86 'brillo/secure_blob.cc',
87 'brillo/strings/string_utils.cc',
88 'brillo/syslog_logging.cc',
89 'brillo/type_name_undecorate.cc',
90 'brillo/url_utils.cc',
91 'brillo/userdb_utils.cc',
Alex Vakulenkob57ecfa2016-01-28 14:41:20 -080092 'brillo/value_conversion.cc',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050093 ],
94 },
95 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -070096 'target_name': 'libbrillo-http-<(libbase_ver)',
Alex Vakulenkof788c952014-08-20 17:35:12 -070097 'type': 'shared_library',
Alex Vakulenko80663bf2015-03-12 17:30:11 -070098 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -070099 'libbrillo-core-<(libbase_ver)',
100 'libbrillo-streams-<(libbase_ver)',
Alex Vakulenko80663bf2015-03-12 17:30:11 -0700101 ],
Alex Vakulenkof788c952014-08-20 17:35:12 -0700102 'variables': {
103 'exported_deps': [
104 'libcurl',
105 ],
106 'deps': ['<@(exported_deps)'],
107 },
108 'all_dependent_settings': {
109 'variables': {
110 'deps': [
111 '<@(exported_deps)',
112 ],
113 },
114 },
Alex Vakulenkof788c952014-08-20 17:35:12 -0700115 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700116 'brillo/http/curl_api.cc',
117 'brillo/http/http_connection_curl.cc',
118 'brillo/http/http_form_data.cc',
119 'brillo/http/http_request.cc',
120 'brillo/http/http_transport.cc',
121 'brillo/http/http_transport_curl.cc',
122 'brillo/http/http_utils.cc',
Alex Vakulenkof788c952014-08-20 17:35:12 -0700123 ],
124 },
125 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700126 'target_name': 'libbrillo-streams-<(libbase_ver)',
Alex Vakulenko1e582b32015-02-26 15:23:23 -0800127 'type': 'shared_library',
128 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700129 'libbrillo-core-<(libbase_ver)',
Alex Vakulenko1e582b32015-02-26 15:23:23 -0800130 ],
Alex Vakulenko7554ede2015-05-06 14:52:50 -0700131 'variables': {
132 'exported_deps': [
133 'openssl',
134 ],
135 'deps': ['<@(exported_deps)'],
136 },
137 'all_dependent_settings': {
138 'variables': {
139 'deps': [
140 '<@(exported_deps)',
141 ],
142 },
143 },
Alex Vakulenko1e582b32015-02-26 15:23:23 -0800144 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700145 'brillo/streams/file_stream.cc',
146 'brillo/streams/input_stream_set.cc',
147 'brillo/streams/memory_containers.cc',
148 'brillo/streams/memory_stream.cc',
149 'brillo/streams/openssl_stream_bio.cc',
150 'brillo/streams/stream.cc',
151 'brillo/streams/stream_errors.cc',
152 'brillo/streams/stream_utils.cc',
153 'brillo/streams/tls_stream.cc',
Alex Vakulenko1e582b32015-02-26 15:23:23 -0800154 ],
155 },
156 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700157 'target_name': 'libbrillo-test-<(libbase_ver)',
Alex Vakulenkof788c952014-08-20 17:35:12 -0700158 'type': 'static_library',
159 'standalone_static_library': 1,
160 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700161 'libbrillo-http-<(libbase_ver)',
Alex Vakulenkof788c952014-08-20 17:35:12 -0700162 ],
163 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700164 'brillo/http/http_connection_fake.cc',
165 'brillo/http/http_transport_fake.cc',
166 'brillo/message_loops/fake_message_loop.cc',
167 'brillo/streams/fake_stream.cc',
Alex Deymo37827b62016-03-29 15:56:29 -0700168 'brillo/unittest_utils.cc',
Alex Vakulenkof788c952014-08-20 17:35:12 -0700169 ],
170 'includes': ['../common-mk/deps.gypi'],
171 },
172 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700173 'target_name': 'libbrillo-cryptohome-<(libbase_ver)',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500174 'type': 'shared_library',
175 'variables': {
Daniel Erat15859412014-06-10 11:19:08 -0700176 'exported_deps': [
Daniel Erat15859412014-06-10 11:19:08 -0700177 'openssl',
178 ],
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500179 'deps': ['<@(exported_deps)'],
180 },
181 'all_dependent_settings': {
182 'variables': {
183 'deps': [
184 '<@(exported_deps)',
185 ],
186 },
187 },
188 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700189 'brillo/cryptohome.cc',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500190 ],
191 },
192 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700193 'target_name': 'libbrillo-minijail-<(libbase_ver)',
Utkarsh Sanghid60f9ae2014-07-29 16:01:43 -0700194 'type': 'shared_library',
Bertrand SIMONNETd6143792015-08-13 14:27:05 -0700195 'variables': {
Bertrand SIMONNET92d2ceb2015-08-14 10:19:52 -0700196 'exported_deps': [
Bertrand SIMONNETd6143792015-08-13 14:27:05 -0700197 'libminijail',
198 ],
Bertrand SIMONNET92d2ceb2015-08-14 10:19:52 -0700199 'deps': ['<@(exported_deps)'],
200 },
201 'all_dependent_settings': {
202 'variables': {
203 'deps': [
204 '<@(exported_deps)',
205 ],
206 },
Bertrand SIMONNETd6143792015-08-13 14:27:05 -0700207 },
Utkarsh Sanghid60f9ae2014-07-29 16:01:43 -0700208 'cflags': [
209 '-fvisibility=default',
210 ],
211 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700212 'brillo/minijail/minijail.cc',
Utkarsh Sanghid60f9ae2014-07-29 16:01:43 -0700213 ],
214 },
215 {
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500216 'target_name': 'libpolicy-<(libbase_ver)',
217 'type': 'shared_library',
Chris Masone242ab242013-11-13 13:26:52 -0800218 'dependencies': [
Bertrand SIMONNET883c3e72014-06-04 13:22:47 -0700219 'libpolicy-includes',
220 '../common-mk/external_dependencies.gyp:policy-protos',
Chris Masone242ab242013-11-13 13:26:52 -0800221 ],
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500222 'variables': {
223 'exported_deps': [
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500224 'openssl',
225 'protobuf-lite',
226 ],
227 'deps': ['<@(exported_deps)'],
228 },
229 'all_dependent_settings': {
230 'variables': {
231 'deps': [
232 '<@(exported_deps)',
233 ],
234 },
235 },
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500236 'ldflags': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700237 '-Wl,--version-script,<(platform2_root)/libbrillo/libpolicy.ver',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500238 ],
239 'sources': [
Alex Deymo3c8d4ab2015-09-02 17:15:00 -0700240 'policy/device_policy.cc',
241 'policy/device_policy_impl.cc',
Igora749d0b2017-09-20 15:56:08 +0200242 'policy/policy_util.cc',
243 'policy/resilient_policy_util.cc',
Alex Deymo3c8d4ab2015-09-02 17:15:00 -0700244 'policy/libpolicy.cc',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500245 ],
246 },
Bertrand SIMONNET211054c2014-06-24 16:33:32 -0700247 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700248 'target_name': 'libbrillo-glib-<(libbase_ver)',
Christopher Wiley8065d312015-07-08 13:11:21 -0700249 'type': 'shared_library',
250 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700251 'libbrillo-<(libbase_ver)',
Christopher Wiley8065d312015-07-08 13:11:21 -0700252 ],
253 'variables': {
254 'exported_deps': [
255 'dbus-1',
256 'dbus-glib-1',
257 'glib-2.0',
258 'gobject-2.0',
259 ],
260 'deps': ['<@(exported_deps)'],
261 },
262 'cflags': [
263 # glib uses the deprecated "register" attribute in some header files.
264 '-Wno-deprecated-register',
265 ],
266 'all_dependent_settings': {
267 'variables': {
268 'deps': [
269 '<@(exported_deps)',
270 ],
271 },
272 },
273 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700274 'brillo/glib/abstract_dbus_service.cc',
275 'brillo/glib/dbus.cc',
276 'brillo/message_loops/glib_message_loop.cc',
Christopher Wiley8065d312015-07-08 13:11:21 -0700277 ],
278 'includes': ['../common-mk/deps.gypi'],
279 },
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500280 ],
281 'conditions': [
282 ['USE_test == 1', {
283 'targets': [
284 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700285 'target_name': 'libbrillo-<(libbase_ver)_unittests',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500286 'type': 'executable',
Daniel Erat8a6c5902014-06-04 13:50:01 -0700287 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700288 'libbrillo-<(libbase_ver)',
289 'libbrillo-test-<(libbase_ver)',
290 'libbrillo-glib-<(libbase_ver)',
Daniel Erat8a6c5902014-06-04 13:50:01 -0700291 ],
Christopher Wileya96e6db2014-08-07 15:47:24 -0700292 'variables': {
293 'deps': [
294 'libchrome-test-<(libbase_ver)',
295 ],
Alex Vakulenkob2135452015-10-19 11:23:51 -0700296 'proto_in_dir': 'brillo/dbus',
Alex Vakulenko2df11632015-10-23 13:43:05 -0700297 'proto_out_dir': 'include/brillo/dbus',
Christopher Wileya96e6db2014-08-07 15:47:24 -0700298 },
Alex Vakulenkod0b4d8d2015-03-31 19:33:31 -0700299 'includes': [
300 '../common-mk/common_test.gypi',
301 '../common-mk/protoc.gypi',
302 ],
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500303 'cflags': [
304 '-Wno-format-zero-length',
305 ],
306 'conditions': [
307 ['debug == 1', {
308 'cflags': [
309 '-fprofile-arcs',
310 '-ftest-coverage',
311 '-fno-inline',
312 ],
313 'libraries': [
314 '-lgcov',
315 ],
316 }],
317 ],
318 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700319 'brillo/any_unittest.cc',
320 'brillo/any_internal_impl_unittest.cc',
321 'brillo/asynchronous_signal_handler_unittest.cc',
322 'brillo/backoff_entry_unittest.cc',
323 'brillo/data_encoding_unittest.cc',
324 'brillo/dbus/async_event_sequencer_unittest.cc',
325 'brillo/dbus/data_serialization_unittest.cc',
326 'brillo/dbus/dbus_method_invoker_unittest.cc',
327 'brillo/dbus/dbus_object_unittest.cc',
328 'brillo/dbus/dbus_param_reader_unittest.cc',
329 'brillo/dbus/dbus_param_writer_unittest.cc',
330 'brillo/dbus/dbus_signal_handler_unittest.cc',
331 'brillo/dbus/exported_object_manager_unittest.cc',
332 'brillo/dbus/exported_property_set_unittest.cc',
333 'brillo/errors/error_codes_unittest.cc',
334 'brillo/errors/error_unittest.cc',
335 'brillo/file_utils_unittest.cc',
336 'brillo/flag_helper_unittest.cc',
337 'brillo/glib/object_unittest.cc',
338 'brillo/http/http_connection_curl_unittest.cc',
339 'brillo/http/http_form_data_unittest.cc',
340 'brillo/http/http_request_unittest.cc',
341 'brillo/http/http_transport_curl_unittest.cc',
342 'brillo/http/http_utils_unittest.cc',
343 'brillo/key_value_store_unittest.cc',
344 'brillo/map_utils_unittest.cc',
Alex Deymod6717462016-01-14 10:50:16 -0800345 'brillo/message_loops/base_message_loop_unittest.cc',
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700346 'brillo/message_loops/fake_message_loop_unittest.cc',
347 'brillo/message_loops/glib_message_loop_unittest.cc',
348 'brillo/message_loops/message_loop_unittest.cc',
349 'brillo/mime_utils_unittest.cc',
350 'brillo/osrelease_reader_unittest.cc',
351 'brillo/process_reaper_unittest.cc',
352 'brillo/process_unittest.cc',
353 'brillo/secure_blob_unittest.cc',
354 'brillo/streams/fake_stream_unittest.cc',
355 'brillo/streams/file_stream_unittest.cc',
356 'brillo/streams/input_stream_set_unittest.cc',
357 'brillo/streams/memory_containers_unittest.cc',
358 'brillo/streams/memory_stream_unittest.cc',
359 'brillo/streams/openssl_stream_bio_unittests.cc',
360 'brillo/streams/stream_unittest.cc',
361 'brillo/streams/stream_utils_unittest.cc',
362 'brillo/strings/string_utils_unittest.cc',
Alex Vakulenko4d8501c2015-12-21 12:05:41 -0800363 'brillo/type_name_undecorate_unittest.cc',
Alex Deymo992e4292015-12-11 19:42:09 -0800364 'brillo/unittest_utils.cc',
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700365 'brillo/url_utils_unittest.cc',
366 'brillo/variant_dictionary_unittest.cc',
Alex Vakulenkob57ecfa2016-01-28 14:41:20 -0800367 'brillo/value_conversion_unittest.cc',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500368 'testrunner.cc',
Alex Vakulenkod0b4d8d2015-03-31 19:33:31 -0700369 '<(proto_in_dir)/test.proto',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500370 ]
371 },
372 {
373 'target_name': 'libpolicy-<(libbase_ver)_unittests',
374 'type': 'executable',
375 'dependencies': ['libpolicy-<(libbase_ver)'],
Bertrand SIMONNET883c3e72014-06-04 13:22:47 -0700376 'includes': ['../common-mk/common_test.gypi'],
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500377 'sources': [
Alex Deymo3c8d4ab2015-09-02 17:15:00 -0700378 'policy/tests/libpolicy_unittest.cc',
Igora749d0b2017-09-20 15:56:08 +0200379 'policy/tests/policy_util_unittest.cc',
380 'policy/tests/resilient_policy_util_unittest.cc',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500381 ]
382 },
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500383 ],
384 }],
385 ],
386}