blob: d0b35045feae534066f810f99cfa8c10d58def67 [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)',
14 ],
Liam McLoughlin4f268f42013-03-04 18:09:53 -050015 },
16 'targets': [
17 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -070018 'target_name': 'libbrillo-<(libbase_ver)',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050019 'type': 'none',
20 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -070021 'libbrillo-core-<(libbase_ver)',
22 'libbrillo-cryptohome-<(libbase_ver)',
23 'libbrillo-http-<(libbase_ver)',
24 'libbrillo-minijail-<(libbase_ver)',
25 'libbrillo-streams-<(libbase_ver)',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050026 'libpolicy-<(libbase_ver)',
27 ],
28 'direct_dependent_settings': {
29 'include_dirs': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -070030 '../libbrillo',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050031 ],
32 },
Bertrand SIMONNET883c3e72014-06-04 13:22:47 -070033 'includes': ['../common-mk/deps.gypi'],
Liam McLoughlin4f268f42013-03-04 18:09:53 -050034 },
35 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -070036 'target_name': 'libbrillo-core-<(libbase_ver)',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050037 'type': 'shared_library',
38 'variables': {
39 'exported_deps': [
40 'dbus-1',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050041 ],
42 'deps': ['<@(exported_deps)'],
43 },
44 'all_dependent_settings': {
45 'variables': {
46 'deps': [
47 '<@(exported_deps)',
48 ],
49 },
50 },
Bertrand SIMONNETf6ec4fc2015-07-15 14:14:19 -070051 'libraries': ['-lmodp_b64'],
Alex Deymo94afaa42015-11-16 16:34:39 -030052 #TODO(deymo): Split DBus code from libbrillo-core the same way is split in
53 # the Android.mk, based on the <(USE_dbus) variable.
Liam McLoughlin4f268f42013-03-04 18:09:53 -050054 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -070055 'brillo/any.cc',
56 'brillo/asynchronous_signal_handler.cc',
57 'brillo/backoff_entry.cc',
58 'brillo/daemons/dbus_daemon.cc',
59 'brillo/daemons/daemon.cc',
60 'brillo/data_encoding.cc',
61 'brillo/dbus/async_event_sequencer.cc',
62 'brillo/dbus/data_serialization.cc',
63 'brillo/dbus/dbus_method_invoker.cc',
64 'brillo/dbus/dbus_method_response.cc',
65 'brillo/dbus/dbus_object.cc',
66 'brillo/dbus/dbus_service_watcher.cc',
67 'brillo/dbus/dbus_signal.cc',
68 'brillo/dbus/exported_object_manager.cc',
69 'brillo/dbus/exported_property_set.cc',
70 'brillo/dbus/utils.cc',
71 'brillo/errors/error.cc',
72 'brillo/errors/error_codes.cc',
73 'brillo/file_utils.cc',
74 'brillo/flag_helper.cc',
75 'brillo/key_value_store.cc',
76 'brillo/message_loops/base_message_loop.cc',
77 'brillo/message_loops/message_loop.cc',
78 'brillo/message_loops/message_loop_utils.cc',
79 'brillo/mime_utils.cc',
80 'brillo/osrelease_reader.cc',
81 'brillo/process.cc',
82 'brillo/process_reaper.cc',
83 'brillo/process_information.cc',
84 'brillo/secure_blob.cc',
85 'brillo/strings/string_utils.cc',
86 'brillo/syslog_logging.cc',
87 'brillo/type_name_undecorate.cc',
88 'brillo/url_utils.cc',
89 'brillo/userdb_utils.cc',
Liam McLoughlin4f268f42013-03-04 18:09:53 -050090 ],
91 },
92 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -070093 'target_name': 'libbrillo-http-<(libbase_ver)',
Alex Vakulenkof788c952014-08-20 17:35:12 -070094 'type': 'shared_library',
Alex Vakulenko80663bf2015-03-12 17:30:11 -070095 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -070096 'libbrillo-core-<(libbase_ver)',
97 'libbrillo-streams-<(libbase_ver)',
Alex Vakulenko80663bf2015-03-12 17:30:11 -070098 ],
Alex Vakulenkof788c952014-08-20 17:35:12 -070099 'variables': {
100 'exported_deps': [
101 'libcurl',
102 ],
103 'deps': ['<@(exported_deps)'],
104 },
105 'all_dependent_settings': {
106 'variables': {
107 'deps': [
108 '<@(exported_deps)',
109 ],
110 },
111 },
Alex Vakulenkof788c952014-08-20 17:35:12 -0700112 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700113 'brillo/http/curl_api.cc',
114 'brillo/http/http_connection_curl.cc',
115 'brillo/http/http_form_data.cc',
116 'brillo/http/http_request.cc',
117 'brillo/http/http_transport.cc',
118 'brillo/http/http_transport_curl.cc',
119 'brillo/http/http_utils.cc',
Alex Vakulenkof788c952014-08-20 17:35:12 -0700120 ],
121 },
122 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700123 'target_name': 'libbrillo-streams-<(libbase_ver)',
Alex Vakulenko1e582b32015-02-26 15:23:23 -0800124 'type': 'shared_library',
125 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700126 'libbrillo-core-<(libbase_ver)',
Alex Vakulenko1e582b32015-02-26 15:23:23 -0800127 ],
Alex Vakulenko7554ede2015-05-06 14:52:50 -0700128 'variables': {
129 'exported_deps': [
130 'openssl',
131 ],
132 'deps': ['<@(exported_deps)'],
133 },
134 'all_dependent_settings': {
135 'variables': {
136 'deps': [
137 '<@(exported_deps)',
138 ],
139 },
140 },
Alex Vakulenko1e582b32015-02-26 15:23:23 -0800141 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700142 'brillo/streams/file_stream.cc',
143 'brillo/streams/input_stream_set.cc',
144 'brillo/streams/memory_containers.cc',
145 'brillo/streams/memory_stream.cc',
146 'brillo/streams/openssl_stream_bio.cc',
147 'brillo/streams/stream.cc',
148 'brillo/streams/stream_errors.cc',
149 'brillo/streams/stream_utils.cc',
150 'brillo/streams/tls_stream.cc',
Alex Vakulenko1e582b32015-02-26 15:23:23 -0800151 ],
152 },
153 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700154 'target_name': 'libbrillo-test-<(libbase_ver)',
Alex Vakulenkof788c952014-08-20 17:35:12 -0700155 'type': 'static_library',
156 'standalone_static_library': 1,
157 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700158 'libbrillo-http-<(libbase_ver)',
Alex Vakulenkof788c952014-08-20 17:35:12 -0700159 ],
160 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700161 'brillo/http/http_connection_fake.cc',
162 'brillo/http/http_transport_fake.cc',
163 'brillo/message_loops/fake_message_loop.cc',
164 'brillo/streams/fake_stream.cc',
Alex Vakulenkof788c952014-08-20 17:35:12 -0700165 ],
166 'includes': ['../common-mk/deps.gypi'],
167 },
168 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700169 'target_name': 'libbrillo-cryptohome-<(libbase_ver)',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500170 'type': 'shared_library',
171 'variables': {
Daniel Erat15859412014-06-10 11:19:08 -0700172 'exported_deps': [
Daniel Erat15859412014-06-10 11:19:08 -0700173 'openssl',
174 ],
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500175 'deps': ['<@(exported_deps)'],
176 },
177 'all_dependent_settings': {
178 'variables': {
179 'deps': [
180 '<@(exported_deps)',
181 ],
182 },
183 },
184 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700185 'brillo/cryptohome.cc',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500186 ],
187 },
188 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700189 'target_name': 'libbrillo-minijail-<(libbase_ver)',
Utkarsh Sanghid60f9ae2014-07-29 16:01:43 -0700190 'type': 'shared_library',
Bertrand SIMONNETd6143792015-08-13 14:27:05 -0700191 'variables': {
Bertrand SIMONNET92d2ceb2015-08-14 10:19:52 -0700192 'exported_deps': [
Bertrand SIMONNETd6143792015-08-13 14:27:05 -0700193 'libminijail',
194 ],
Bertrand SIMONNET92d2ceb2015-08-14 10:19:52 -0700195 'deps': ['<@(exported_deps)'],
196 },
197 'all_dependent_settings': {
198 'variables': {
199 'deps': [
200 '<@(exported_deps)',
201 ],
202 },
Bertrand SIMONNETd6143792015-08-13 14:27:05 -0700203 },
Utkarsh Sanghid60f9ae2014-07-29 16:01:43 -0700204 'cflags': [
205 '-fvisibility=default',
206 ],
207 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700208 'brillo/minijail/minijail.cc',
Utkarsh Sanghid60f9ae2014-07-29 16:01:43 -0700209 ],
210 },
211 {
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500212 'target_name': 'libpolicy-<(libbase_ver)',
213 'type': 'shared_library',
Chris Masone242ab242013-11-13 13:26:52 -0800214 'dependencies': [
Bertrand SIMONNET883c3e72014-06-04 13:22:47 -0700215 'libpolicy-includes',
216 '../common-mk/external_dependencies.gyp:policy-protos',
Chris Masone242ab242013-11-13 13:26:52 -0800217 ],
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500218 'variables': {
219 'exported_deps': [
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500220 'openssl',
221 'protobuf-lite',
222 ],
223 'deps': ['<@(exported_deps)'],
224 },
225 'all_dependent_settings': {
226 'variables': {
227 'deps': [
228 '<@(exported_deps)',
229 ],
230 },
231 },
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500232 'ldflags': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700233 '-Wl,--version-script,<(platform2_root)/libbrillo/libpolicy.ver',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500234 ],
235 'sources': [
Alex Deymo3c8d4ab2015-09-02 17:15:00 -0700236 'policy/device_policy.cc',
237 'policy/device_policy_impl.cc',
238 'policy/libpolicy.cc',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500239 ],
240 },
Bertrand SIMONNET211054c2014-06-24 16:33:32 -0700241 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700242 'target_name': 'libbrillo-glib-<(libbase_ver)',
Christopher Wiley8065d312015-07-08 13:11:21 -0700243 'type': 'shared_library',
244 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700245 'libbrillo-<(libbase_ver)',
Christopher Wiley8065d312015-07-08 13:11:21 -0700246 ],
247 'variables': {
248 'exported_deps': [
249 'dbus-1',
250 'dbus-glib-1',
251 'glib-2.0',
252 'gobject-2.0',
253 ],
254 'deps': ['<@(exported_deps)'],
255 },
256 'cflags': [
257 # glib uses the deprecated "register" attribute in some header files.
258 '-Wno-deprecated-register',
259 ],
260 'all_dependent_settings': {
261 'variables': {
262 'deps': [
263 '<@(exported_deps)',
264 ],
265 },
266 },
267 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700268 'brillo/glib/abstract_dbus_service.cc',
269 'brillo/glib/dbus.cc',
270 'brillo/message_loops/glib_message_loop.cc',
Christopher Wiley8065d312015-07-08 13:11:21 -0700271 ],
272 'includes': ['../common-mk/deps.gypi'],
273 },
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500274 ],
275 'conditions': [
276 ['USE_test == 1', {
277 'targets': [
278 {
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700279 'target_name': 'libbrillo-<(libbase_ver)_unittests',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500280 'type': 'executable',
Daniel Erat8a6c5902014-06-04 13:50:01 -0700281 'dependencies': [
Alex Vakulenkofed60b02015-10-27 09:53:05 -0700282 'libbrillo-<(libbase_ver)',
283 'libbrillo-test-<(libbase_ver)',
284 'libbrillo-glib-<(libbase_ver)',
Daniel Erat8a6c5902014-06-04 13:50:01 -0700285 ],
Christopher Wileya96e6db2014-08-07 15:47:24 -0700286 'variables': {
287 'deps': [
288 'libchrome-test-<(libbase_ver)',
289 ],
Alex Vakulenkob2135452015-10-19 11:23:51 -0700290 'proto_in_dir': 'brillo/dbus',
Alex Vakulenko2df11632015-10-23 13:43:05 -0700291 'proto_out_dir': 'include/brillo/dbus',
Christopher Wileya96e6db2014-08-07 15:47:24 -0700292 },
Alex Vakulenkod0b4d8d2015-03-31 19:33:31 -0700293 'includes': [
294 '../common-mk/common_test.gypi',
295 '../common-mk/protoc.gypi',
296 ],
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500297 'cflags': [
298 '-Wno-format-zero-length',
299 ],
300 'conditions': [
301 ['debug == 1', {
302 'cflags': [
303 '-fprofile-arcs',
304 '-ftest-coverage',
305 '-fno-inline',
306 ],
307 'libraries': [
308 '-lgcov',
309 ],
310 }],
311 ],
312 'sources': [
Alex Vakulenko9ed0cab2015-10-12 15:21:28 -0700313 'brillo/any_unittest.cc',
314 'brillo/any_internal_impl_unittest.cc',
315 'brillo/asynchronous_signal_handler_unittest.cc',
316 'brillo/backoff_entry_unittest.cc',
317 'brillo/data_encoding_unittest.cc',
318 'brillo/dbus/async_event_sequencer_unittest.cc',
319 'brillo/dbus/data_serialization_unittest.cc',
320 'brillo/dbus/dbus_method_invoker_unittest.cc',
321 'brillo/dbus/dbus_object_unittest.cc',
322 'brillo/dbus/dbus_param_reader_unittest.cc',
323 'brillo/dbus/dbus_param_writer_unittest.cc',
324 'brillo/dbus/dbus_signal_handler_unittest.cc',
325 'brillo/dbus/exported_object_manager_unittest.cc',
326 'brillo/dbus/exported_property_set_unittest.cc',
327 'brillo/errors/error_codes_unittest.cc',
328 'brillo/errors/error_unittest.cc',
329 'brillo/file_utils_unittest.cc',
330 'brillo/flag_helper_unittest.cc',
331 'brillo/glib/object_unittest.cc',
332 'brillo/http/http_connection_curl_unittest.cc',
333 'brillo/http/http_form_data_unittest.cc',
334 'brillo/http/http_request_unittest.cc',
335 'brillo/http/http_transport_curl_unittest.cc',
336 'brillo/http/http_utils_unittest.cc',
337 'brillo/key_value_store_unittest.cc',
338 'brillo/map_utils_unittest.cc',
339 'brillo/message_loops/fake_message_loop_unittest.cc',
340 'brillo/message_loops/glib_message_loop_unittest.cc',
341 'brillo/message_loops/message_loop_unittest.cc',
342 'brillo/mime_utils_unittest.cc',
343 'brillo/osrelease_reader_unittest.cc',
344 'brillo/process_reaper_unittest.cc',
345 'brillo/process_unittest.cc',
346 'brillo/secure_blob_unittest.cc',
347 'brillo/streams/fake_stream_unittest.cc',
348 'brillo/streams/file_stream_unittest.cc',
349 'brillo/streams/input_stream_set_unittest.cc',
350 'brillo/streams/memory_containers_unittest.cc',
351 'brillo/streams/memory_stream_unittest.cc',
352 'brillo/streams/openssl_stream_bio_unittests.cc',
353 'brillo/streams/stream_unittest.cc',
354 'brillo/streams/stream_utils_unittest.cc',
355 'brillo/strings/string_utils_unittest.cc',
356 'brillo/url_utils_unittest.cc',
357 'brillo/variant_dictionary_unittest.cc',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500358 'testrunner.cc',
Alex Vakulenkod0b4d8d2015-03-31 19:33:31 -0700359 '<(proto_in_dir)/test.proto',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500360 ]
361 },
362 {
363 'target_name': 'libpolicy-<(libbase_ver)_unittests',
364 'type': 'executable',
365 'dependencies': ['libpolicy-<(libbase_ver)'],
Bertrand SIMONNET883c3e72014-06-04 13:22:47 -0700366 'includes': ['../common-mk/common_test.gypi'],
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500367 'sources': [
Alex Deymo3c8d4ab2015-09-02 17:15:00 -0700368 'policy/tests/libpolicy_unittest.cc',
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500369 ]
370 },
Liam McLoughlin4f268f42013-03-04 18:09:53 -0500371 ],
372 }],
373 ],
374}