Home | History | Annotate | Download | only in libchrome
      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.
     18 local_use_dbus := $(if $(BRILLO_USE_DBUS),$(BRILLO_USE_DBUS),1)
     19 
     20 LOCAL_PATH := $(call my-dir)
     21 
     22 # Common variables
     23 # ========================================================
     24 
     25 # Set libchromeUseClang to "true" to force clang or "false" to force gcc.
     26 libchromeUseClang :=
     27 libchromeCommonCppExtension := .cc
     28 libchromeTestCFlags := -Wno-unused-parameter -Wno-unused-function \
     29 	-Wno-missing-field-initializers
     30 libchromeCommonCFlags := -Wall -Werror
     31 libchromeCommonCIncludes := \
     32 	external/gmock/include \
     33 	external/gtest/include \
     34 	external/valgrind/include \
     35 	external/valgrind \
     36 
     37 libchromeExportedCIncludes := $(LOCAL_PATH) $(TOP)/external/gtest/include
     38 
     39 libchromeCommonSrc := \
     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 
    205 libchromeLinuxSrc := \
    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 
    219 libchromeMacSrc := \
    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 
    241 libchromeCommonUnittestSrc := \
    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 
    380 libchromeCryptoUnittestSrc := \
    381 	crypto/secure_hash_unittest.cc \
    382 	crypto/sha2_unittest.cc \
    383 
    384 libchromeHostCFlags := -D__ANDROID_HOST__
    385 
    386 ifeq ($(HOST_OS),linux)
    387 libchromeHostSrc := $(libchromeLinuxSrc)
    388 libchromeHostLdFlags :=
    389 endif
    390 
    391 ifeq ($(HOST_OS),darwin)
    392 libchromeHostSrc := $(libchromeMacSrc)
    393 libchromeHostCFlags += -D_FILE_OFFSET_BITS=64 -Wno-deprecated-declarations
    394 libchromeHostLdFlags := \
    395 	-framework AppKit \
    396 	-framework CoreFoundation \
    397 	-framework Foundation \
    398 	-framework Security
    399 endif
    400 
    401 # libchrome shared library for target
    402 # ========================================================
    403 include $(CLEAR_VARS)
    404 LOCAL_MODULE := libchrome
    405 LOCAL_SRC_FILES := $(libchromeCommonSrc) $(libchromeLinuxSrc) base/sys_info_chromeos.cc
    406 LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
    407 LOCAL_CFLAGS := $(libchromeCommonCFlags)
    408 LOCAL_CLANG := $(libchromeUseClang)
    409 LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
    410 LOCAL_SHARED_LIBRARIES := libevent liblog libcutils
    411 LOCAL_STATIC_LIBRARIES := libmodpb64
    412 LOCAL_EXPORT_C_INCLUDE_DIRS := $(libchromeExportedCIncludes)
    413 include $(BUILD_SHARED_LIBRARY)
    414 
    415 # libchrome shared library for host
    416 # ========================================================
    417 include $(CLEAR_VARS)
    418 LOCAL_MODULE := libchrome
    419 LOCAL_CFLAGS := $(libchromeCommonCFlags) $(libchromeHostCFlags)
    420 LOCAL_CLANG := $(libchromeUseClang)
    421 LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
    422 LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
    423 LOCAL_EXPORT_C_INCLUDE_DIRS := $(libchromeExportedCIncludes)
    424 LOCAL_SHARED_LIBRARIES := libevent-host
    425 LOCAL_STATIC_LIBRARIES := libmodpb64-host
    426 LOCAL_SRC_FILES := $(libchromeCommonSrc) $(libchromeHostSrc)
    427 LOCAL_LDFLAGS := $(libchromeHostLdFlags)
    428 include $(BUILD_HOST_SHARED_LIBRARY)
    429 
    430 ifeq ($(local_use_dbus),1)
    431 
    432 # libchrome-dbus shared library for target
    433 # ========================================================
    434 include $(CLEAR_VARS)
    435 LOCAL_MODULE := libchrome-dbus
    436 LOCAL_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 
    451 LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
    452 LOCAL_CFLAGS := $(libchromeCommonCFlags)
    453 LOCAL_CLANG := $(libchromeUseClang)
    454 LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
    455 LOCAL_SHARED_LIBRARIES := \
    456 	libchrome \
    457 	libdbus \
    458 	libprotobuf-cpp-lite \
    459 
    460 LOCAL_STATIC_LIBRARIES :=
    461 LOCAL_EXPORT_C_INCLUDE_DIRS := $(libchromeExportedCIncludes)
    462 include $(BUILD_SHARED_LIBRARY)
    463 
    464 endif  # local_use_dbus == 1
    465 
    466 # libchrome-crypto shared library for target
    467 # ========================================================
    468 include $(CLEAR_VARS)
    469 LOCAL_MODULE := libchrome-crypto
    470 LOCAL_SRC_FILES := \
    471 	crypto/openssl_util.cc \
    472 	crypto/secure_hash_openssl.cc \
    473 	crypto/secure_util.cc \
    474 	crypto/sha2.cc \
    475 
    476 LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
    477 LOCAL_CFLAGS := $(libchromeCommonCFlags) -Wno-unused-parameter
    478 LOCAL_CPPFLAGS := $(libchromeCommonCppFlags)
    479 LOCAL_CLANG := $(libchromeUseClang)
    480 LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
    481 LOCAL_SHARED_LIBRARIES := \
    482 	libchrome \
    483 	libcrypto \
    484 	libssl \
    485 
    486 LOCAL_STATIC_LIBRARIES :=
    487 LOCAL_EXPORT_C_INCLUDE_DIRS := $(libchromeExportedCIncludes)
    488 include $(BUILD_SHARED_LIBRARY)
    489 
    490 # Helpers needed for unit tests.
    491 # ========================================================
    492 include $(CLEAR_VARS)
    493 LOCAL_MODULE := libchrome_test_helpers
    494 LOCAL_SHARED_LIBRARIES := libchrome
    495 LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
    496 LOCAL_CFLAGS := $(libchromeCommonCFlags) $(libchromeTestCFlags)
    497 LOCAL_CLANG := $(libchromeUseClang)
    498 LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
    499 LOCAL_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 
    507 include $(BUILD_STATIC_LIBRARY)
    508 
    509 ifeq ($(local_use_dbus),1)
    510 
    511 # Helpers needed for D-Bus unit tests.
    512 # ========================================================
    513 include $(CLEAR_VARS)
    514 LOCAL_MODULE := libchrome_dbus_test_helpers
    515 LOCAL_SHARED_LIBRARIES := libdbus libchrome-dbus
    516 LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
    517 LOCAL_CFLAGS := $(libchromeCommonCFlags) $(libchromeTestCFlags)
    518 LOCAL_CLANG := $(libchromeUseClang)
    519 LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
    520 LOCAL_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 
    526 include $(BUILD_STATIC_LIBRARY)
    527 
    528 endif  # local_use_dbus == 1
    529 
    530 # Helpers needed for unit tests (for host).
    531 # ========================================================
    532 ifeq ($(HOST_OS),linux)
    533 include $(CLEAR_VARS)
    534 LOCAL_MODULE := libchrome_test_helpers-host
    535 LOCAL_SHARED_LIBRARIES := libchrome
    536 LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
    537 LOCAL_CFLAGS := $(libchromeCommonCFlags) $(libchromeTestCFlags)
    538 LOCAL_CLANG := $(libchromeUseClang)
    539 LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
    540 LOCAL_SRC_FILES := base/test/simple_test_clock.cc
    541 include $(BUILD_HOST_STATIC_LIBRARY)
    542 
    543 # Host unit tests. Run (from repo root) with:
    544 # ./out/host/<arch>/bin/libchrome_test
    545 # ========================================================
    546 include $(CLEAR_VARS)
    547 LOCAL_MODULE := libchrome_test
    548 ifdef BRILLO
    549   LOCAL_MODULE_TAGS := debug
    550 endif
    551 LOCAL_SRC_FILES := $(libchromeCommonUnittestSrc)
    552 LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
    553 LOCAL_CFLAGS := $(libchromeCommonCFlags) $(libchromeTestCFlags) $(libchromeHostCFlags) -DUNIT_TEST
    554 LOCAL_CLANG := $(libchromeUseClang)
    555 LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
    556 LOCAL_SHARED_LIBRARIES := libchrome libevent-host
    557 LOCAL_STATIC_LIBRARIES := libgmock_host libgtest_host
    558 LOCAL_LDLIBS := -lrt
    559 include $(BUILD_HOST_NATIVE_TEST)
    560 endif
    561 
    562 # Native unit tests. Run with:
    563 # adb shell /data/nativetest/libchrome_test/libchrome_test
    564 # ========================================================
    565 include $(CLEAR_VARS)
    566 LOCAL_MODULE := libchrome_test
    567 ifdef BRILLO
    568   LOCAL_MODULE_TAGS := eng
    569 endif
    570 LOCAL_SRC_FILES := $(libchromeCryptoUnittestSrc) $(libchromeCommonUnittestSrc)
    571 LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension)
    572 LOCAL_CFLAGS := $(libchromeCommonCFlags) $(libchromeTestCFlags) -DUNIT_TEST -DDONT_EMBED_BUILD_METADATA
    573 LOCAL_CLANG := $(libchromeUseClang)
    574 LOCAL_C_INCLUDES := $(libchromeCommonCIncludes)
    575 LOCAL_SHARED_LIBRARIES := libchrome libchrome-crypto libevent
    576 LOCAL_STATIC_LIBRARIES := libgmock libgtest
    577 include $(BUILD_NATIVE_TEST)
    578