1# Copyright (C) 2015 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# Default values for the USE flags. Override these USE flags from your product
16# by setting BRILLO_USE_* values. Note that we define local variables like
17# local_use_* to prevent leaking our default setting for other packages.
18local_use_dbus := $(if $(BRILLO_USE_DBUS),$(BRILLO_USE_DBUS),1)
19
20LOCAL_PATH := $(call my-dir)
21
22# Common variables
23# ========================================================
24
25# Set libchromeUseClang to "true" to force clang or "false" to force gcc.
26libchromeUseClang :=
27libchromeCommonCppExtension := .cc
28libchromeTestCFlags := -Wno-unused-parameter -Wno-unused-function \
29	-Wno-missing-field-initializers
30libchromeCommonCFlags := -Wall -Werror
31libchromeCommonCIncludes := \
32	external/gmock/include \
33	external/gtest/include \
34	external/valgrind/include \
35	external/valgrind \
36
37libchromeExportedCIncludes := $(LOCAL_PATH) $(TOP)/external/gtest/include
38
39libchromeCommonSrc := \
40	base/at_exit.cc \
41	base/base64.cc \
42	base/base64url.cc \
43	base/base_switches.cc \
44	base/bind_helpers.cc \
45	base/build_time.cc \
46	base/callback_helpers.cc \
47	base/callback_internal.cc \
48	base/command_line.cc \
49	base/cpu.cc \
50	base/debug/alias.cc \
51	base/debug/debugger.cc \
52	base/debug/debugger_posix.cc \
53	base/debug/stack_trace.cc \
54	base/debug/stack_trace_posix.cc \
55	base/debug/task_annotator.cc \
56	base/environment.cc \
57	base/files/file.cc \
58	base/files/file_enumerator.cc \
59	base/files/file_enumerator_posix.cc \
60	base/files/file_path.cc \
61	base/files/file_path_constants.cc \
62	base/files/file_path_watcher.cc \
63	base/files/file_posix.cc \
64	base/files/file_tracing.cc \
65	base/files/file_util.cc \
66	base/files/file_util_posix.cc \
67	base/files/important_file_writer.cc \
68	base/files/scoped_file.cc \
69	base/files/scoped_temp_dir.cc \
70	base/guid.cc \
71	base/guid_posix.cc \
72	base/json/json_file_value_serializer.cc \
73	base/json/json_parser.cc \
74	base/json/json_reader.cc \
75	base/json/json_string_value_serializer.cc \
76	base/json/json_value_converter.cc \
77	base/json/json_writer.cc \
78	base/json/string_escape.cc \
79	base/lazy_instance.cc \
80	base/location.cc \
81	base/logging.cc \
82	base/md5.cc \
83	base/memory/aligned_memory.cc \
84	base/memory/ref_counted.cc \
85	base/memory/ref_counted_memory.cc \
86	base/memory/singleton.cc \
87	base/memory/weak_ptr.cc \
88	base/message_loop/incoming_task_queue.cc \
89	base/message_loop/message_loop.cc \
90	base/message_loop/message_loop_task_runner.cc \
91	base/message_loop/message_pump.cc \
92	base/message_loop/message_pump_default.cc \
93	base/message_loop/message_pump_libevent.cc \
94	base/metrics/bucket_ranges.cc \
95	base/metrics/field_trial.cc \
96	base/metrics/metrics_hashes.cc \
97	base/metrics/histogram_base.cc \
98	base/metrics/histogram.cc \
99	base/metrics/histogram_samples.cc \
100	base/metrics/histogram_snapshot_manager.cc \
101	base/metrics/sample_map.cc \
102	base/metrics/sample_vector.cc \
103	base/metrics/sparse_histogram.cc \
104	base/metrics/statistics_recorder.cc \
105	base/pending_task.cc \
106	base/pickle.cc \
107	base/posix/file_descriptor_shuffle.cc \
108	base/posix/safe_strerror.cc \
109	base/process/kill.cc \
110	base/process/kill_posix.cc \
111	base/process/launch.cc \
112	base/process/launch_posix.cc \
113	base/process/process_handle.cc \
114	base/process/process_handle_posix.cc \
115	base/process/process_iterator.cc \
116	base/process/process_metrics.cc \
117	base/process/process_metrics_posix.cc \
118	base/process/process_posix.cc \
119	base/profiler/alternate_timer.cc \
120	base/profiler/scoped_profile.cc \
121	base/profiler/scoped_tracker.cc \
122	base/profiler/tracked_time.cc \
123	base/rand_util.cc \
124	base/rand_util_posix.cc \
125	base/run_loop.cc \
126	base/sequence_checker_impl.cc \
127	base/sequenced_task_runner.cc \
128	base/sha1_portable.cc \
129	base/strings/pattern.cc \
130	base/strings/safe_sprintf.cc \
131	base/strings/string16.cc \
132	base/strings/string_number_conversions.cc \
133	base/strings/string_piece.cc \
134	base/strings/stringprintf.cc \
135	base/strings/string_split.cc \
136	base/strings/string_util.cc \
137	base/strings/string_util_constants.cc \
138	base/strings/utf_string_conversions.cc \
139	base/strings/utf_string_conversion_utils.cc \
140	base/synchronization/cancellation_flag.cc \
141	base/synchronization/condition_variable_posix.cc \
142	base/synchronization/lock.cc \
143	base/synchronization/lock_impl_posix.cc \
144	base/synchronization/waitable_event_posix.cc \
145	base/sync_socket_posix.cc \
146	base/sys_info.cc \
147	base/sys_info_posix.cc \
148	base/task/cancelable_task_tracker.cc \
149	base/task_runner.cc \
150	base/third_party/icu/icu_utf.cc \
151	base/third_party/nspr/prtime.cc \
152	base/threading/non_thread_safe_impl.cc \
153	base/threading/platform_thread_posix.cc \
154	base/threading/post_task_and_reply_impl.cc \
155	base/threading/sequenced_worker_pool.cc \
156	base/threading/simple_thread.cc \
157	base/threading/thread.cc \
158	base/threading/thread_checker_impl.cc \
159	base/threading/thread_collision_warner.cc \
160	base/threading/thread_id_name_manager.cc \
161	base/threading/thread_local_posix.cc \
162	base/threading/thread_local_storage.cc \
163	base/threading/thread_local_storage_posix.cc \
164	base/threading/thread_restrictions.cc \
165	base/threading/worker_pool.cc \
166	base/threading/worker_pool_posix.cc \
167	base/thread_task_runner_handle.cc \
168	base/time/clock.cc \
169	base/time/default_clock.cc \
170	base/time/default_tick_clock.cc \
171	base/time/tick_clock.cc \
172	base/time/time.cc \
173	base/time/time_posix.cc \
174	base/timer/elapsed_timer.cc \
175	base/timer/timer.cc \
176	base/trace_event/heap_profiler_allocation_context.cc \
177	base/trace_event/heap_profiler_allocation_context_tracker.cc \
178	base/trace_event/heap_profiler_stack_frame_deduplicator.cc \
179	base/trace_event/heap_profiler_type_name_deduplicator.cc \
180	base/trace_event/memory_allocator_dump.cc \
181	base/trace_event/memory_allocator_dump_guid.cc \
182	base/trace_event/memory_dump_manager.cc \
183	base/trace_event/malloc_dump_provider.cc \
184	base/trace_event/memory_dump_request_args.cc \
185	base/trace_event/memory_dump_session_state.cc \
186	base/trace_event/process_memory_dump.cc \
187	base/trace_event/process_memory_maps.cc \
188	base/trace_event/process_memory_maps_dump_provider.cc \
189	base/trace_event/process_memory_totals.cc \
190	base/trace_event/process_memory_totals_dump_provider.cc \
191	base/trace_event/trace_buffer.cc \
192	base/trace_event/trace_config.cc \
193	base/trace_event/trace_event_argument.cc \
194	base/trace_event/trace_event_impl.cc \
195	base/trace_event/trace_event_memory_overhead.cc \
196	base/trace_event/trace_event_synthetic_delay.cc \
197	base/trace_event/trace_log.cc \
198	base/trace_event/trace_log_constants.cc \
199	base/trace_event/trace_sampling_thread.cc \
200	base/tracked_objects.cc \
201	base/tracking_info.cc \
202	base/values.cc \
203	base/vlog.cc \
204
205libchromeLinuxSrc := \
206	base/files/file_path_watcher_linux.cc \
207	base/files/file_util_linux.cc \
208	base/posix/unix_domain_socket_linux.cc \
209	base/process/internal_linux.cc \
210	base/process/process_handle_linux.cc \
211	base/process/process_iterator_linux.cc \
212	base/process/process_metrics_linux.cc \
213	base/strings/sys_string_conversions_posix.cc \
214	base/sys_info_linux.cc \
215	base/threading/platform_thread_internal_posix.cc \
216	base/threading/platform_thread_linux.cc \
217	components/timers/alarm_timer_chromeos.cc \
218
219libchromeMacSrc := \
220	base/files/file_path_watcher_fsevents.cc \
221	base/files/file_path_watcher_kqueue.cc \
222	base/files/file_path_watcher_mac.cc \
223	base/files/file_util_mac.mm \
224	base/mac/bundle_locations.mm \
225	base/mac/foundation_util.mm \
226	base/mac/mach_logging.cc \
227	base/mac/libdispatch_task_runner.cc \
228	base/mac/scoped_mach_port.cc \
229	base/mac/scoped_nsautorelease_pool.mm \
230	base/message_loop/message_pump_mac.mm \
231	base/process/launch_mac.cc \
232	base/process/port_provider_mac.cc \
233	base/process/process_handle_mac.cc \
234	base/process/process_iterator_mac.cc \
235	base/process/process_metrics_mac.cc \
236	base/strings/sys_string_conversions_mac.mm \
237	base/sys_info_mac.cc \
238	base/time/time_mac.cc \
239	base/threading/platform_thread_mac.mm \
240
241libchromeCommonUnittestSrc := \
242	base/at_exit_unittest.cc \
243	base/atomicops_unittest.cc \
244	base/base64_unittest.cc \
245	base/base64url_unittest.cc \
246	base/bind_unittest.cc \
247	base/bits_unittest.cc \
248	base/build_time_unittest.cc \
249	base/callback_helpers_unittest.cc \
250	base/callback_list_unittest.cc \
251	base/callback_unittest.cc \
252	base/cancelable_callback_unittest.cc \
253	base/command_line_unittest.cc \
254	base/cpu_unittest.cc \
255	base/debug/debugger_unittest.cc \
256	base/debug/leak_tracker_unittest.cc \
257	base/debug/task_annotator_unittest.cc \
258	base/environment_unittest.cc \
259	base/file_version_info_unittest.cc \
260	base/files/dir_reader_posix_unittest.cc \
261	base/files/file_path_watcher_unittest.cc \
262	base/files/file_path_unittest.cc \
263	base/files/file_unittest.cc \
264	base/files/important_file_writer_unittest.cc \
265	base/files/scoped_temp_dir_unittest.cc \
266	base/gmock_unittest.cc \
267	base/guid_unittest.cc \
268	base/id_map_unittest.cc \
269	base/json/json_parser_unittest.cc \
270	base/json/json_reader_unittest.cc \
271	base/json/json_value_converter_unittest.cc \
272	base/json/json_value_serializer_unittest.cc \
273	base/json/json_writer_unittest.cc \
274	base/json/string_escape_unittest.cc \
275	base/lazy_instance_unittest.cc \
276	base/logging_unittest.cc \
277	base/md5_unittest.cc \
278	base/memory/aligned_memory_unittest.cc \
279	base/memory/linked_ptr_unittest.cc \
280	base/memory/ref_counted_memory_unittest.cc \
281	base/memory/ref_counted_unittest.cc \
282	base/memory/scoped_ptr_unittest.cc \
283	base/memory/scoped_vector_unittest.cc \
284	base/memory/singleton_unittest.cc \
285	base/memory/weak_ptr_unittest.cc \
286	base/message_loop/message_loop_test.cc \
287	base/message_loop/message_loop_task_runner_unittest.cc \
288	base/message_loop/message_loop_unittest.cc \
289	base/metrics/bucket_ranges_unittest.cc \
290	base/metrics/field_trial_unittest.cc \
291	base/metrics/metrics_hashes_unittest.cc \
292	base/metrics/histogram_base_unittest.cc \
293	base/metrics/histogram_macros_unittest.cc \
294	base/metrics/histogram_snapshot_manager_unittest.cc \
295	base/metrics/histogram_unittest.cc \
296	base/metrics/sample_map_unittest.cc \
297	base/metrics/sample_vector_unittest.cc \
298	base/metrics/sparse_histogram_unittest.cc \
299	base/metrics/statistics_recorder_unittest.cc \
300	base/numerics/safe_numerics_unittest.cc \
301	base/observer_list_unittest.cc \
302	base/pickle_unittest.cc \
303	base/posix/file_descriptor_shuffle_unittest.cc \
304	base/posix/unix_domain_socket_linux_unittest.cc \
305	base/process/process_metrics_unittest.cc \
306	base/profiler/tracked_time_unittest.cc \
307	base/rand_util_unittest.cc \
308	base/scoped_clear_errno_unittest.cc \
309	base/scoped_generic_unittest.cc \
310	base/security_unittest.cc \
311	base/sequence_checker_unittest.cc \
312	base/sha1_unittest.cc \
313	base/stl_util_unittest.cc \
314	base/strings/pattern_unittest.cc \
315	base/strings/string16_unittest.cc \
316	base/strings/string_number_conversions_unittest.cc \
317	base/strings/string_piece_unittest.cc \
318	base/strings/stringprintf_unittest.cc \
319	base/strings/string_split_unittest.cc \
320	base/strings/string_util_unittest.cc \
321	base/strings/sys_string_conversions_unittest.cc \
322	base/strings/utf_string_conversions_unittest.cc \
323	base/synchronization/cancellation_flag_unittest.cc \
324	base/synchronization/condition_variable_unittest.cc \
325	base/synchronization/lock_unittest.cc \
326	base/synchronization/waitable_event_unittest.cc \
327	base/sync_socket_unittest.cc \
328	base/sys_info_unittest.cc \
329	base/task/cancelable_task_tracker_unittest.cc \
330	base/task_runner_util_unittest.cc \
331	base/template_util_unittest.cc \
332	base/test/multiprocess_test.cc \
333	base/test/multiprocess_test_android.cc \
334	base/test/opaque_ref_counted.cc \
335	base/test/scoped_locale.cc \
336	base/test/sequenced_worker_pool_owner.cc \
337	base/test/test_file_util.cc \
338	base/test/test_file_util_linux.cc \
339	base/test/test_file_util_posix.cc \
340	base/test/test_io_thread.cc \
341	base/test/test_pending_task.cc \
342	base/test/test_simple_task_runner.cc \
343	base/test/test_switches.cc \
344	base/test/test_timeouts.cc \
345	base/test/trace_event_analyzer.cc \
346	base/threading/non_thread_safe_unittest.cc \
347	base/threading/platform_thread_unittest.cc \
348	base/threading/simple_thread_unittest.cc \
349	base/threading/thread_checker_unittest.cc \
350	base/threading/thread_collision_warner_unittest.cc \
351	base/threading/thread_id_name_manager_unittest.cc \
352	base/threading/thread_local_storage_unittest.cc \
353	base/threading/thread_local_unittest.cc \
354	base/threading/thread_unittest.cc \
355	base/threading/worker_pool_posix_unittest.cc \
356	base/threading/worker_pool_unittest.cc \
357	base/time/pr_time_unittest.cc \
358	base/time/time_unittest.cc \
359	base/timer/hi_res_timer_manager_unittest.cc \
360	base/timer/timer_unittest.cc \
361	base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc \
362	base/trace_event/heap_profiler_stack_frame_deduplicator_unittest.cc \
363	base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc \
364	base/trace_event/memory_allocator_dump_unittest.cc \
365	base/trace_event/memory_dump_manager_unittest.cc \
366	base/trace_event/process_memory_dump_unittest.cc \
367	base/trace_event/process_memory_maps_dump_provider_unittest.cc \
368	base/trace_event/process_memory_totals_dump_provider_unittest.cc \
369	base/trace_event/trace_config_unittest.cc \
370	base/trace_event/trace_event_argument_unittest.cc \
371	base/trace_event/trace_event_synthetic_delay_unittest.cc \
372	base/trace_event/trace_event_unittest.cc \
373	base/tracked_objects_unittest.cc \
374	base/tuple_unittest.cc \
375	base/values_unittest.cc \
376	base/vlog_unittest.cc \
377	testing/multiprocess_func_list.cc \
378	testrunner.cc \
379
380libchromeCryptoUnittestSrc := \
381	crypto/secure_hash_unittest.cc \
382	crypto/sha2_unittest.cc \
383
384libchromeHostCFlags := -D__ANDROID_HOST__
385
386ifeq ($(HOST_OS),linux)
387libchromeHostSrc := $(libchromeLinuxSrc)
388libchromeHostLdFlags :=
389endif
390
391ifeq ($(HOST_OS),darwin)
392libchromeHostSrc := $(libchromeMacSrc)
393libchromeHostCFlags += -D_FILE_OFFSET_BITS=64 -Wno-deprecated-declarations
394libchromeHostLdFlags := \
395	-framework AppKit \
396	-framework CoreFoundation \
397	-framework Foundation \
398	-framework Security
399endif
400
401# libchrome shared library for target
402# ========================================================
403include $(CLEAR_VARS)
404LOCAL_MODULE := libchrome
405LOCAL_SRC_FILES := $(libchromeCommonSrc) $(libchromeLinuxSrc) base/sys_info_chromeos.cc
406LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
407LOCAL_CFLAGS := $(libchromeCommonCFlags)
408LOCAL_CLANG := $(libchromeUseClang)
409LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
410LOCAL_SHARED_LIBRARIES := libevent liblog libcutils
411LOCAL_STATIC_LIBRARIES := libmodpb64
412LOCAL_EXPORT_C_INCLUDE_DIRS := $(libchromeExportedCIncludes)
413include $(BUILD_SHARED_LIBRARY)
414
415# libchrome shared library for host
416# ========================================================
417include $(CLEAR_VARS)
418LOCAL_MODULE := libchrome
419LOCAL_CFLAGS := $(libchromeCommonCFlags) $(libchromeHostCFlags)
420LOCAL_CLANG := $(libchromeUseClang)
421LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
422LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
423LOCAL_EXPORT_C_INCLUDE_DIRS := $(libchromeExportedCIncludes)
424LOCAL_SHARED_LIBRARIES := libevent-host
425LOCAL_STATIC_LIBRARIES := libmodpb64-host
426LOCAL_SRC_FILES := $(libchromeCommonSrc) $(libchromeHostSrc)
427LOCAL_LDFLAGS := $(libchromeHostLdFlags)
428include $(BUILD_HOST_SHARED_LIBRARY)
429
430ifeq ($(local_use_dbus),1)
431
432# libchrome-dbus shared library for target
433# ========================================================
434include $(CLEAR_VARS)
435LOCAL_MODULE := libchrome-dbus
436LOCAL_SRC_FILES := \
437	dbus/bus.cc \
438	dbus/dbus_statistics.cc \
439	dbus/exported_object.cc \
440	dbus/file_descriptor.cc \
441	dbus/message.cc \
442	dbus/object_manager.cc \
443	dbus/object_path.cc \
444	dbus/object_proxy.cc \
445	dbus/property.cc \
446	dbus/scoped_dbus_error.cc \
447	dbus/string_util.cc \
448	dbus/util.cc \
449	dbus/values_util.cc \
450
451LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
452LOCAL_CFLAGS := $(libchromeCommonCFlags)
453LOCAL_CLANG := $(libchromeUseClang)
454LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
455LOCAL_SHARED_LIBRARIES := \
456	libchrome \
457	libdbus \
458	libprotobuf-cpp-lite \
459
460LOCAL_STATIC_LIBRARIES :=
461LOCAL_EXPORT_C_INCLUDE_DIRS := $(libchromeExportedCIncludes)
462include $(BUILD_SHARED_LIBRARY)
463
464endif  # local_use_dbus == 1
465
466# libchrome-crypto shared library for target
467# ========================================================
468include $(CLEAR_VARS)
469LOCAL_MODULE := libchrome-crypto
470LOCAL_SRC_FILES := \
471	crypto/openssl_util.cc \
472	crypto/secure_hash_openssl.cc \
473	crypto/secure_util.cc \
474	crypto/sha2.cc \
475
476LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
477LOCAL_CFLAGS := $(libchromeCommonCFlags) -Wno-unused-parameter
478LOCAL_CPPFLAGS := $(libchromeCommonCppFlags)
479LOCAL_CLANG := $(libchromeUseClang)
480LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
481LOCAL_SHARED_LIBRARIES := \
482	libchrome \
483	libcrypto \
484	libssl \
485
486LOCAL_STATIC_LIBRARIES :=
487LOCAL_EXPORT_C_INCLUDE_DIRS := $(libchromeExportedCIncludes)
488include $(BUILD_SHARED_LIBRARY)
489
490# Helpers needed for unit tests.
491# ========================================================
492include $(CLEAR_VARS)
493LOCAL_MODULE := libchrome_test_helpers
494LOCAL_SHARED_LIBRARIES := libchrome
495LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
496LOCAL_CFLAGS := $(libchromeCommonCFlags) $(libchromeTestCFlags)
497LOCAL_CLANG := $(libchromeUseClang)
498LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
499LOCAL_SRC_FILES := \
500	base/test/simple_test_clock.cc \
501	base/test/simple_test_tick_clock.cc \
502	base/test/test_file_util.cc \
503	base/test/test_file_util_linux.cc \
504	base/test/test_switches.cc \
505	base/test/test_timeouts.cc \
506
507include $(BUILD_STATIC_LIBRARY)
508
509ifeq ($(local_use_dbus),1)
510
511# Helpers needed for D-Bus unit tests.
512# ========================================================
513include $(CLEAR_VARS)
514LOCAL_MODULE := libchrome_dbus_test_helpers
515LOCAL_SHARED_LIBRARIES := libdbus libchrome-dbus
516LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
517LOCAL_CFLAGS := $(libchromeCommonCFlags) $(libchromeTestCFlags)
518LOCAL_CLANG := $(libchromeUseClang)
519LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
520LOCAL_SRC_FILES := \
521	dbus/mock_bus.cc \
522	dbus/mock_exported_object.cc \
523	dbus/mock_object_manager.cc \
524	dbus/mock_object_proxy.cc \
525
526include $(BUILD_STATIC_LIBRARY)
527
528endif  # local_use_dbus == 1
529
530# Helpers needed for unit tests (for host).
531# ========================================================
532ifeq ($(HOST_OS),linux)
533include $(CLEAR_VARS)
534LOCAL_MODULE := libchrome_test_helpers-host
535LOCAL_SHARED_LIBRARIES := libchrome
536LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
537LOCAL_CFLAGS := $(libchromeCommonCFlags) $(libchromeTestCFlags)
538LOCAL_CLANG := $(libchromeUseClang)
539LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
540LOCAL_SRC_FILES := base/test/simple_test_clock.cc
541include $(BUILD_HOST_STATIC_LIBRARY)
542
543# Host unit tests. Run (from repo root) with:
544# ./out/host/<arch>/bin/libchrome_test
545# ========================================================
546include $(CLEAR_VARS)
547LOCAL_MODULE := libchrome_test
548ifdef BRILLO
549  LOCAL_MODULE_TAGS := debug
550endif
551LOCAL_SRC_FILES := $(libchromeCommonUnittestSrc)
552LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
553LOCAL_CFLAGS := $(libchromeCommonCFlags) $(libchromeTestCFlags) $(libchromeHostCFlags) -DUNIT_TEST
554LOCAL_CLANG := $(libchromeUseClang)
555LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
556LOCAL_SHARED_LIBRARIES := libchrome libevent-host
557LOCAL_STATIC_LIBRARIES := libgmock_host libgtest_host
558LOCAL_LDLIBS := -lrt
559include $(BUILD_HOST_NATIVE_TEST)
560endif
561
562# Native unit tests. Run with:
563# adb shell /data/nativetest/libchrome_test/libchrome_test
564# ========================================================
565include $(CLEAR_VARS)
566LOCAL_MODULE := libchrome_test
567ifdef BRILLO
568  LOCAL_MODULE_TAGS := eng
569endif
570LOCAL_SRC_FILES := $(libchromeCryptoUnittestSrc) $(libchromeCommonUnittestSrc)
571LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
572LOCAL_CFLAGS := $(libchromeCommonCFlags) $(libchromeTestCFlags) -DUNIT_TEST -DDONT_EMBED_BUILD_METADATA
573LOCAL_CLANG := $(libchromeUseClang)
574LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
575LOCAL_SHARED_LIBRARIES := libchrome libchrome-crypto libevent
576LOCAL_STATIC_LIBRARIES := libgmock libgtest
577include $(BUILD_NATIVE_TEST)
578