• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2  'target_defaults': {
3    'variables': {
4      'deps': [
5        'libchrome-<(libbase_ver)'
6      ],
7      'USE_dbus%': '1',
8    },
9    'include_dirs': [
10      '../libbrillo',
11    ],
12    'defines': [
13      'USE_DBUS=<(USE_dbus)',
14      'USE_RTTI_FOR_TYPE_TAGS',
15    ],
16  },
17  'targets': [
18    {
19      'target_name': 'libbrillo-<(libbase_ver)',
20      'type': 'none',
21      'dependencies': [
22        'libbrillo-core-<(libbase_ver)',
23        'libbrillo-cryptohome-<(libbase_ver)',
24        'libbrillo-http-<(libbase_ver)',
25        'libbrillo-minijail-<(libbase_ver)',
26        'libbrillo-streams-<(libbase_ver)',
27        'libpolicy-<(libbase_ver)',
28      ],
29      'direct_dependent_settings': {
30        'include_dirs': [
31          '../libbrillo',
32        ],
33      },
34      'includes': ['../common-mk/deps.gypi'],
35    },
36    {
37      'target_name': 'libbrillo-core-<(libbase_ver)',
38      'type': 'shared_library',
39      'variables': {
40        'exported_deps': [
41          'dbus-1',
42        ],
43        'deps': ['<@(exported_deps)'],
44      },
45      'all_dependent_settings': {
46        'variables': {
47          'deps': [
48            '<@(exported_deps)',
49          ],
50        },
51      },
52      'libraries': ['-lmodp_b64'],
53      #TODO(deymo): Split DBus code from libbrillo-core the same way is split in
54      # the Android.mk, based on the <(USE_dbus) variable.
55      'sources': [
56        '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',
64        'brillo/dbus/dbus_connection.cc',
65        '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',
92        'brillo/value_conversion.cc',
93      ],
94    },
95    {
96      'target_name': 'libbrillo-http-<(libbase_ver)',
97      'type': 'shared_library',
98      'dependencies': [
99        'libbrillo-core-<(libbase_ver)',
100        'libbrillo-streams-<(libbase_ver)',
101      ],
102      '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      },
115      'sources': [
116        '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',
123      ],
124    },
125    {
126      'target_name': 'libbrillo-streams-<(libbase_ver)',
127      'type': 'shared_library',
128      'dependencies': [
129        'libbrillo-core-<(libbase_ver)',
130      ],
131      '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      },
144      'sources': [
145        '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',
154      ],
155    },
156    {
157      'target_name': 'libbrillo-test-<(libbase_ver)',
158      'type': 'static_library',
159      'standalone_static_library': 1,
160      'dependencies': [
161        'libbrillo-http-<(libbase_ver)',
162      ],
163      'sources': [
164        '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',
168        'brillo/unittest_utils.cc',
169      ],
170      'includes': ['../common-mk/deps.gypi'],
171    },
172    {
173      'target_name': 'libbrillo-cryptohome-<(libbase_ver)',
174      'type': 'shared_library',
175      'variables': {
176        'exported_deps': [
177          'openssl',
178        ],
179        'deps': ['<@(exported_deps)'],
180      },
181      'all_dependent_settings': {
182        'variables': {
183          'deps': [
184            '<@(exported_deps)',
185          ],
186        },
187      },
188      'sources': [
189        'brillo/cryptohome.cc',
190      ],
191    },
192    {
193      'target_name': 'libbrillo-minijail-<(libbase_ver)',
194      'type': 'shared_library',
195      'variables': {
196        'exported_deps': [
197          'libminijail',
198        ],
199        'deps': ['<@(exported_deps)'],
200      },
201      'all_dependent_settings': {
202        'variables': {
203          'deps': [
204            '<@(exported_deps)',
205          ],
206        },
207      },
208      'cflags': [
209        '-fvisibility=default',
210      ],
211      'sources': [
212        'brillo/minijail/minijail.cc',
213      ],
214    },
215    {
216      'target_name': 'libpolicy-<(libbase_ver)',
217      'type': 'shared_library',
218      'dependencies': [
219        'libpolicy-includes',
220        '../common-mk/external_dependencies.gyp:policy-protos',
221      ],
222      'variables': {
223        'exported_deps': [
224          'openssl',
225          'protobuf-lite',
226        ],
227        'deps': ['<@(exported_deps)'],
228      },
229      'all_dependent_settings': {
230        'variables': {
231          'deps': [
232            '<@(exported_deps)',
233          ],
234        },
235      },
236      'ldflags': [
237        '-Wl,--version-script,<(platform2_root)/libbrillo/libpolicy.ver',
238      ],
239      'sources': [
240        'policy/device_policy.cc',
241        'policy/device_policy_impl.cc',
242        'policy/policy_util.cc',
243        'policy/resilient_policy_util.cc',
244        'policy/libpolicy.cc',
245      ],
246    },
247    {
248      'target_name': 'libbrillo-glib-<(libbase_ver)',
249      'type': 'shared_library',
250      'dependencies': [
251          'libbrillo-<(libbase_ver)',
252      ],
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': [
274        'brillo/glib/abstract_dbus_service.cc',
275        'brillo/glib/dbus.cc',
276        'brillo/message_loops/glib_message_loop.cc',
277      ],
278      'includes': ['../common-mk/deps.gypi'],
279    },
280  ],
281  'conditions': [
282    ['USE_test == 1', {
283      'targets': [
284        {
285          'target_name': 'libbrillo-<(libbase_ver)_unittests',
286          'type': 'executable',
287          'dependencies': [
288            'libbrillo-<(libbase_ver)',
289            'libbrillo-test-<(libbase_ver)',
290            'libbrillo-glib-<(libbase_ver)',
291          ],
292          'variables': {
293            'deps': [
294              'libchrome-test-<(libbase_ver)',
295            ],
296            'proto_in_dir': 'brillo/dbus',
297            'proto_out_dir': 'include/brillo/dbus',
298          },
299          'includes': [
300            '../common-mk/common_test.gypi',
301            '../common-mk/protoc.gypi',
302          ],
303          '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': [
319            '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',
345            'brillo/message_loops/base_message_loop_unittest.cc',
346            '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',
363            'brillo/type_name_undecorate_unittest.cc',
364            'brillo/unittest_utils.cc',
365            'brillo/url_utils_unittest.cc',
366            'brillo/variant_dictionary_unittest.cc',
367            'brillo/value_conversion_unittest.cc',
368            'testrunner.cc',
369            '<(proto_in_dir)/test.proto',
370          ]
371        },
372        {
373          'target_name': 'libpolicy-<(libbase_ver)_unittests',
374          'type': 'executable',
375          'dependencies': ['libpolicy-<(libbase_ver)'],
376          'includes': ['../common-mk/common_test.gypi'],
377          'sources': [
378            'policy/tests/libpolicy_unittest.cc',
379            'policy/tests/policy_util_unittest.cc',
380            'policy/tests/resilient_policy_util_unittest.cc',
381          ]
382        },
383      ],
384    }],
385  ],
386}
387