Bookmark Associator Refactoring
[chromium-blink-merge.git] / base / BUILD.gn
blob6473536036b87b26013528802892259a61265fc2
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/ui.gni")
6 import("//testing/test.gni")
8 if (is_android) {
9   import("//build/config/android/rules.gni")
12 config("base_implementation") {
13   defines = [ "BASE_IMPLEMENTATION" ]
16 if (is_win) {
17   # This is in a separate config so the flags can be applied to dependents.
18   # ldflags in GN aren't automatically inherited.
19   config("base_win_linker_flags") {
20     ldflags = [
21       "/DELAYLOAD:cfgmgr32.dll",
22       "/DELAYLOAD:powrprof.dll",
23       "/DELAYLOAD:setupapi.dll",
24     ]
25   }
28 source_set("base_paths") {
29   sources = [
30     "base_paths.cc",
31     "base_paths.h",
32     "base_paths_android.cc",
33     "base_paths_android.h",
34     "base_paths_mac.h",
35     "base_paths_mac.mm",
36     "base_paths_posix.cc",
37     "base_paths_posix.h",
38     "base_paths_win.cc",
39     "base_paths_win.h",
40   ]
42   if (is_android || is_mac) {
43     sources -= [ "base_paths_posix.cc" ]
44   }
46   if (is_nacl) {
47     sources -= [
48       "base_paths.cc",
49       "base_paths_posix.cc",
50     ]
51   }
53   configs += [ ":base_implementation" ]
55   deps = [
56     "//base/memory",
57     "//base/process",
58   ]
60   visibility = [ ":base" ]
63 component("base") {
64   sources = [
65     "allocator/allocator_extension.cc",
66     "allocator/allocator_extension.h",
67     "allocator/type_profiler_control.cc",
68     "allocator/type_profiler_control.h",
69     "android/animation_frame_time_histogram.cc",
70     "android/animation_frame_time_histogram.h",
71     "android/application_status_listener.cc",
72     "android/application_status_listener.h",
73     "android/base_jni_onload.cc",
74     "android/base_jni_onload.h",
75     "android/base_jni_registrar.cc",
76     "android/base_jni_registrar.h",
77     "android/build_info.cc",
78     "android/build_info.h",
79     "android/command_line_android.cc",
80     "android/command_line_android.h",
81     "android/content_uri_utils.cc",
82     "android/content_uri_utils.h",
83     "android/cpu_features.cc",
84     "android/event_log.cc",
85     "android/event_log.h",
86     "android/field_trial_list.cc",
87     "android/field_trial_list.h",
88     "android/fifo_utils.cc",
89     "android/fifo_utils.h",
90     "android/important_file_writer_android.cc",
91     "android/important_file_writer_android.h",
92     "android/java_handler_thread.cc",
93     "android/java_handler_thread.h",
94     "android/java_runtime.cc",
95     "android/java_runtime.h",
96     "android/jni_android.cc",
97     "android/jni_android.h",
98     "android/jni_array.cc",
99     "android/jni_array.h",
100     "android/jni_registrar.cc",
101     "android/jni_registrar.h",
102     "android/jni_string.cc",
103     "android/jni_string.h",
104     "android/jni_utils.cc",
105     "android/jni_utils.h",
106     "android/jni_weak_ref.cc",
107     "android/jni_weak_ref.h",
108     "android/library_loader/library_load_from_apk_status_codes.h",
109     "android/library_loader/library_loader_hooks.cc",
110     "android/library_loader/library_loader_hooks.h",
111     "android/library_loader/library_prefetcher.cc",
112     "android/library_loader/library_prefetcher.h",
113     "android/locale_utils.cc",
114     "android/locale_utils.h",
115     "android/memory_pressure_listener_android.cc",
116     "android/memory_pressure_listener_android.h",
117     "android/path_service_android.cc",
118     "android/path_service_android.h",
119     "android/path_utils.cc",
120     "android/path_utils.h",
121     "android/record_histogram.cc",
122     "android/record_histogram.h",
123     "android/record_user_action.cc",
124     "android/record_user_action.h",
125     "android/scoped_java_ref.cc",
126     "android/scoped_java_ref.h",
127     "android/sys_utils.cc",
128     "android/sys_utils.h",
129     "android/thread_utils.h",
130     "android/trace_event_binding.cc",
131     "android/trace_event_binding.h",
132     "async_socket_io_handler.h",
133     "async_socket_io_handler_posix.cc",
134     "async_socket_io_handler_win.cc",
135     "at_exit.cc",
136     "at_exit.h",
137     "atomic_ref_count.h",
138     "atomic_sequence_num.h",
139     "atomicops.h",
140     "atomicops_internals_gcc.h",
141     "atomicops_internals_mac.h",
142     "atomicops_internals_portable.h",
143     "atomicops_internals_x86_gcc.cc",
144     "atomicops_internals_x86_gcc.h",
145     "atomicops_internals_x86_msvc.h",
146     "auto_reset.h",
147     "barrier_closure.cc",
148     "barrier_closure.h",
149     "base64.cc",
150     "base64.h",
151     "base_export.h",
152     "base_switches.h",
153     "basictypes.h",
154     "big_endian.cc",
155     "big_endian.h",
156     "bind.h",
157     "bind_helpers.cc",
158     "bind_helpers.h",
159     "bind_internal.h",
160     "bind_internal_win.h",
161     "bits.h",
162     "build_time.cc",
163     "build_time.h",
164     "callback.h",
165     "callback_helpers.cc",
166     "callback_helpers.h",
167     "callback_internal.cc",
168     "callback_internal.h",
169     "cancelable_callback.h",
170     "chromeos/memory_pressure_monitor_chromeos.cc",
171     "chromeos/memory_pressure_monitor_chromeos.h",
172     "command_line.cc",
173     "command_line.h",
174     "compiler_specific.h",
175     "containers/adapters.h",
176     "containers/hash_tables.h",
177     "containers/linked_list.h",
178     "containers/mru_cache.h",
179     "containers/scoped_ptr_hash_map.h",
180     "containers/small_map.h",
181     "containers/stack_container.h",
182     "cpu.cc",
183     "cpu.h",
184     "critical_closure.h",
185     "critical_closure_internal_ios.mm",
186     "deferred_sequenced_task_runner.cc",
187     "deferred_sequenced_task_runner.h",
188     "environment.cc",
189     "environment.h",
190     "file_descriptor_posix.h",
191     "file_version_info.h",
192     "file_version_info_mac.h",
193     "file_version_info_mac.mm",
194     "file_version_info_win.cc",
195     "file_version_info_win.h",
196     "files/dir_reader_fallback.h",
197     "files/dir_reader_linux.h",
198     "files/dir_reader_posix.h",
199     "files/file.cc",
200     "files/file_enumerator.cc",
201     "files/file_enumerator.h",
202     "files/file_enumerator_posix.cc",
203     "files/file_enumerator_win.cc",
204     "files/file_path.cc",
205     "files/file_path.h",
206     "files/file_path_constants.cc",
207     "files/file_path_watcher.cc",
208     "files/file_path_watcher.h",
209     "files/file_path_watcher_fsevents.cc",
210     "files/file_path_watcher_fsevents.h",
211     "files/file_path_watcher_kqueue.cc",
212     "files/file_path_watcher_kqueue.h",
213     "files/file_path_watcher_linux.cc",
214     "files/file_path_watcher_mac.cc",
215     "files/file_path_watcher_win.cc",
216     "files/file_posix.cc",
217     "files/file_proxy.cc",
218     "files/file_proxy.h",
219     "files/file_util.cc",
220     "files/file_util.h",
221     "files/file_util_android.cc",
222     "files/file_util_linux.cc",
223     "files/file_util_mac.mm",
224     "files/file_util_posix.cc",
225     "files/file_util_proxy.cc",
226     "files/file_util_proxy.h",
227     "files/file_util_win.cc",
228     "files/file_win.cc",
229     "files/important_file_writer.cc",
230     "files/important_file_writer.h",
231     "files/memory_mapped_file.cc",
232     "files/memory_mapped_file.h",
233     "files/memory_mapped_file_posix.cc",
234     "files/memory_mapped_file_win.cc",
235     "files/scoped_file.cc",
236     "files/scoped_file.h",
237     "files/scoped_temp_dir.cc",
238     "files/scoped_temp_dir.h",
239     "format_macros.h",
240     "gtest_prod_util.h",
241     "guid.cc",
242     "guid.h",
243     "guid_posix.cc",
244     "guid_win.cc",
245     "hash.cc",
246     "hash.h",
247     "id_map.h",
248     "ios/device_util.h",
249     "ios/device_util.mm",
250     "ios/ios_util.h",
251     "ios/ios_util.mm",
252     "ios/scoped_critical_action.h",
253     "ios/scoped_critical_action.mm",
254     "ios/weak_nsobject.h",
255     "ios/weak_nsobject.mm",
256     "lazy_instance.cc",
257     "lazy_instance.h",
258     "linux_util.cc",
259     "linux_util.h",
260     "location.cc",
261     "location.h",
262     "logging.cc",
263     "logging.h",
264     "logging_win.cc",
265     "logging_win.h",
266     "mac/authorization_util.h",
267     "mac/authorization_util.mm",
268     "mac/bind_objc_block.h",
269     "mac/bundle_locations.h",
270     "mac/bundle_locations.mm",
271     "mac/cocoa_protocols.h",
272     "mac/foundation_util.h",
273     "mac/foundation_util.mm",
274     "mac/launch_services_util.cc",
275     "mac/launch_services_util.h",
276     "mac/launchd.cc",
277     "mac/launchd.h",
278     "mac/libdispatch_task_runner.cc",
279     "mac/libdispatch_task_runner.h",
280     "mac/mac_logging.cc",
281     "mac/mac_logging.h",
282     "mac/mac_util.h",
283     "mac/mac_util.mm",
284     "mac/mach_logging.cc",
285     "mac/mach_logging.h",
286     "mac/objc_property_releaser.h",
287     "mac/objc_property_releaser.mm",
288     "mac/os_crash_dumps.cc",
289     "mac/os_crash_dumps.h",
290     "mac/scoped_aedesc.h",
291     "mac/scoped_authorizationref.h",
292     "mac/scoped_block.h",
293     "mac/scoped_cftyperef.h",
294     "mac/scoped_ioobject.h",
295     "mac/scoped_ioplugininterface.h",
296     "mac/scoped_launch_data.h",
297     "mac/scoped_mach_port.cc",
298     "mac/scoped_mach_port.h",
299     "mac/scoped_mach_vm.cc",
300     "mac/scoped_mach_vm.h",
301     "mac/scoped_nsautorelease_pool.h",
302     "mac/scoped_nsautorelease_pool.mm",
303     "mac/scoped_nsexception_enabler.h",
304     "mac/scoped_nsexception_enabler.mm",
305     "mac/scoped_nsobject.h",
306     "mac/scoped_objc_class_swizzler.h",
307     "mac/scoped_objc_class_swizzler.mm",
308     "mac/scoped_sending_event.h",
309     "mac/scoped_sending_event.mm",
310     "mac/sdk_forward_declarations.h",
311     "mac/sdk_forward_declarations.mm",
312     "macros.h",
313     "md5.cc",
314     "md5.h",
315     "message_loop/incoming_task_queue.cc",
316     "message_loop/incoming_task_queue.h",
317     "message_loop/message_loop.cc",
318     "message_loop/message_loop.h",
319     "message_loop/message_loop_proxy.cc",
320     "message_loop/message_loop_proxy.h",
321     "message_loop/message_loop_proxy_impl.cc",
322     "message_loop/message_loop_proxy_impl.h",
323     "message_loop/message_pump.cc",
324     "message_loop/message_pump.h",
325     "message_loop/message_pump_android.cc",
326     "message_loop/message_pump_android.h",
327     "message_loop/message_pump_default.cc",
328     "message_loop/message_pump_default.h",
329     "message_loop/message_pump_glib.cc",
330     "message_loop/message_pump_glib.h",
331     "message_loop/message_pump_io_ios.cc",
332     "message_loop/message_pump_io_ios.h",
333     "message_loop/message_pump_libevent.cc",
334     "message_loop/message_pump_libevent.h",
335     "message_loop/message_pump_mac.h",
336     "message_loop/message_pump_mac.mm",
337     "message_loop/message_pump_win.cc",
338     "message_loop/message_pump_win.h",
339     "move.h",
340     "native_library.h",
341     "native_library_ios.mm",
342     "native_library_mac.mm",
343     "native_library_posix.cc",
344     "native_library_win.cc",
345     "nix/mime_util_xdg.cc",
346     "nix/mime_util_xdg.h",
347     "nix/xdg_util.cc",
348     "nix/xdg_util.h",
349     "numerics/safe_conversions.h",
350     "numerics/safe_conversions_impl.h",
351     "numerics/safe_math.h",
352     "numerics/safe_math_impl.h",
353     "observer_list.h",
354     "observer_list_threadsafe.h",
355     "os_compat_android.cc",
356     "os_compat_android.h",
357     "os_compat_nacl.cc",
358     "os_compat_nacl.h",
359     "path_service.cc",
360     "path_service.h",
361     "pending_task.cc",
362     "pending_task.h",
363     "pickle.cc",
364     "pickle.h",
365     "port.h",
366     "posix/eintr_wrapper.h",
367     "posix/file_descriptor_shuffle.cc",
368     "posix/global_descriptors.cc",
369     "posix/global_descriptors.h",
370     "posix/unix_domain_socket_linux.cc",
371     "posix/unix_domain_socket_linux.h",
372     "power_monitor/power_monitor.cc",
373     "power_monitor/power_monitor.h",
374     "power_monitor/power_monitor_device_source.cc",
375     "power_monitor/power_monitor_device_source.h",
376     "power_monitor/power_monitor_device_source_android.cc",
377     "power_monitor/power_monitor_device_source_android.h",
378     "power_monitor/power_monitor_device_source_chromeos.cc",
379     "power_monitor/power_monitor_device_source_ios.mm",
380     "power_monitor/power_monitor_device_source_mac.mm",
381     "power_monitor/power_monitor_device_source_posix.cc",
382     "power_monitor/power_monitor_device_source_win.cc",
383     "power_monitor/power_monitor_source.cc",
384     "power_monitor/power_monitor_source.h",
385     "power_monitor/power_observer.h",
386     "profiler/alternate_timer.cc",
387     "profiler/alternate_timer.h",
388     "profiler/native_stack_sampler.cc",
389     "profiler/native_stack_sampler.h",
390     "profiler/scoped_profile.cc",
391     "profiler/scoped_profile.h",
392     "profiler/scoped_tracker.cc",
393     "profiler/scoped_tracker.h",
394     "profiler/stack_sampling_profiler.cc",
395     "profiler/stack_sampling_profiler.h",
396     "profiler/stack_sampling_profiler_posix.cc",
397     "profiler/stack_sampling_profiler_win.cc",
398     "profiler/tracked_time.cc",
399     "profiler/tracked_time.h",
400     "rand_util.cc",
401     "rand_util.h",
402     "rand_util_nacl.cc",
403     "rand_util_posix.cc",
404     "rand_util_win.cc",
405     "run_loop.cc",
406     "run_loop.h",
407     "safe_strerror_posix.cc",
408     "safe_strerror_posix.h",
409     "scoped_generic.h",
410     "scoped_native_library.cc",
411     "scoped_native_library.h",
412     "scoped_observer.h",
413     "sequence_checker.h",
414     "sequence_checker_impl.cc",
415     "sequence_checker_impl.h",
416     "sequenced_task_runner.cc",
417     "sequenced_task_runner.h",
418     "sequenced_task_runner_helpers.h",
419     "sha1.h",
420     "sha1_portable.cc",
421     "sha1_win.cc",
422     "single_thread_task_runner.h",
423     "stl_util.h",
424     "strings/latin1_string_conversions.cc",
425     "strings/latin1_string_conversions.h",
426     "strings/nullable_string16.cc",
427     "strings/nullable_string16.h",
428     "strings/safe_sprintf.cc",
429     "strings/safe_sprintf.h",
430     "strings/string16.cc",
431     "strings/string16.h",
432     "strings/string_number_conversions.cc",
433     "strings/string_number_conversions.h",
434     "strings/string_piece.cc",
435     "strings/string_piece.h",
436     "strings/string_split.cc",
437     "strings/string_split.h",
438     "strings/string_tokenizer.h",
439     "strings/string_util.cc",
440     "strings/string_util.h",
441     "strings/string_util_constants.cc",
442     "strings/string_util_posix.h",
443     "strings/string_util_win.h",
444     "strings/stringize_macros.h",
445     "strings/stringprintf.cc",
446     "strings/stringprintf.h",
447     "strings/sys_string_conversions.h",
448     "strings/sys_string_conversions_mac.mm",
449     "strings/sys_string_conversions_posix.cc",
450     "strings/sys_string_conversions_win.cc",
451     "strings/utf_offset_string_conversions.cc",
452     "strings/utf_offset_string_conversions.h",
453     "strings/utf_string_conversion_utils.cc",
454     "strings/utf_string_conversion_utils.h",
455     "strings/utf_string_conversions.cc",
456     "strings/utf_string_conversions.h",
457     "supports_user_data.cc",
458     "supports_user_data.h",
459     "sync_socket.h",
460     "sync_socket_posix.cc",
461     "sync_socket_win.cc",
462     "synchronization/cancellation_flag.cc",
463     "synchronization/cancellation_flag.h",
464     "synchronization/condition_variable.h",
465     "synchronization/condition_variable_posix.cc",
466     "synchronization/condition_variable_win.cc",
467     "synchronization/lock.cc",
468     "synchronization/lock.h",
469     "synchronization/lock_impl.h",
470     "synchronization/lock_impl_posix.cc",
471     "synchronization/lock_impl_win.cc",
472     "synchronization/spin_wait.h",
473     "synchronization/waitable_event.h",
474     "synchronization/waitable_event_posix.cc",
475     "synchronization/waitable_event_watcher.h",
476     "synchronization/waitable_event_watcher_posix.cc",
477     "synchronization/waitable_event_watcher_win.cc",
478     "synchronization/waitable_event_win.cc",
479     "sys_byteorder.h",
480     "sys_info.cc",
481     "sys_info.h",
482     "sys_info_android.cc",
483     "sys_info_chromeos.cc",
484     "sys_info_freebsd.cc",
485     "sys_info_ios.mm",
486     "sys_info_linux.cc",
487     "sys_info_mac.cc",
488     "sys_info_openbsd.cc",
489     "sys_info_posix.cc",
490     "sys_info_win.cc",
491     "system_monitor/system_monitor.cc",
492     "system_monitor/system_monitor.h",
493     "task/cancelable_task_tracker.cc",
494     "task/cancelable_task_tracker.h",
495     "task_runner.cc",
496     "task_runner.h",
497     "task_runner_util.h",
498     "template_util.h",
499     "third_party/dmg_fp/dmg_fp.h",
500     "third_party/dmg_fp/dtoa_wrapper.cc",
501     "third_party/dmg_fp/g_fmt.cc",
502     "third_party/icu/icu_utf.cc",
503     "third_party/icu/icu_utf.h",
504     "third_party/nspr/prtime.cc",
505     "third_party/nspr/prtime.h",
506     "third_party/superfasthash/superfasthash.c",
507     "thread_task_runner_handle.cc",
508     "thread_task_runner_handle.h",
509     "threading/non_thread_safe.h",
510     "threading/non_thread_safe_impl.cc",
511     "threading/non_thread_safe_impl.h",
512     "threading/platform_thread.h",
513     "threading/platform_thread_android.cc",
514     "threading/platform_thread_internal_posix.cc",
515     "threading/platform_thread_internal_posix.h",
516     "threading/platform_thread_linux.cc",
517     "threading/platform_thread_mac.mm",
518     "threading/platform_thread_posix.cc",
519     "threading/platform_thread_win.cc",
520     "threading/post_task_and_reply_impl.cc",
521     "threading/post_task_and_reply_impl.h",
522     "threading/sequenced_worker_pool.cc",
523     "threading/sequenced_worker_pool.h",
524     "threading/simple_thread.cc",
525     "threading/simple_thread.h",
526     "threading/thread.cc",
527     "threading/thread.h",
528     "threading/thread_checker.h",
529     "threading/thread_checker_impl.cc",
530     "threading/thread_checker_impl.h",
531     "threading/thread_collision_warner.cc",
532     "threading/thread_collision_warner.h",
533     "threading/thread_id_name_manager.cc",
534     "threading/thread_id_name_manager.h",
535     "threading/thread_local.h",
536     "threading/thread_local_android.cc",
537     "threading/thread_local_posix.cc",
538     "threading/thread_local_storage.cc",
539     "threading/thread_local_storage.h",
540     "threading/thread_local_storage_posix.cc",
541     "threading/thread_local_storage_win.cc",
542     "threading/thread_local_win.cc",
543     "threading/thread_restrictions.cc",
544     "threading/thread_restrictions.h",
545     "threading/watchdog.cc",
546     "threading/watchdog.h",
547     "threading/worker_pool.cc",
548     "threading/worker_pool.h",
549     "threading/worker_pool_posix.cc",
550     "threading/worker_pool_posix.h",
551     "threading/worker_pool_win.cc",
552     "time/clock.cc",
553     "time/clock.h",
554     "time/default_clock.cc",
555     "time/default_clock.h",
556     "time/default_tick_clock.cc",
557     "time/default_tick_clock.h",
558     "time/tick_clock.cc",
559     "time/tick_clock.h",
560     "time/time.cc",
561     "time/time.h",
562     "time/time_mac.cc",
563     "time/time_posix.cc",
564     "time/time_win.cc",
565     "timer/elapsed_timer.cc",
566     "timer/elapsed_timer.h",
567     "timer/hi_res_timer_manager.h",
568     "timer/hi_res_timer_manager_posix.cc",
569     "timer/hi_res_timer_manager_win.cc",
570     "timer/mock_timer.cc",
571     "timer/mock_timer.h",
572     "timer/timer.cc",
573     "timer/timer.h",
574     "tracked_objects.cc",
575     "tracked_objects.h",
576     "tracking_info.cc",
577     "tracking_info.h",
578     "tuple.h",
579     "value_conversions.cc",
580     "value_conversions.h",
581     "values.cc",
582     "values.h",
583     "version.cc",
584     "version.h",
585     "vlog.cc",
586     "vlog.h",
587     "win/enum_variant.cc",
588     "win/enum_variant.h",
589     "win/event_trace_consumer.h",
590     "win/event_trace_controller.cc",
591     "win/event_trace_controller.h",
592     "win/event_trace_provider.cc",
593     "win/event_trace_provider.h",
594     "win/i18n.cc",
595     "win/i18n.h",
596     "win/iat_patch_function.cc",
597     "win/iat_patch_function.h",
598     "win/iunknown_impl.cc",
599     "win/iunknown_impl.h",
600     "win/message_window.cc",
601     "win/message_window.h",
602     "win/metro.cc",
603     "win/metro.h",
604     "win/object_watcher.cc",
605     "win/object_watcher.h",
606     "win/registry.cc",
607     "win/registry.h",
608     "win/resource_util.cc",
609     "win/resource_util.h",
610     "win/scoped_bstr.cc",
611     "win/scoped_bstr.h",
612     "win/scoped_co_mem.h",
613     "win/scoped_com_initializer.h",
614     "win/scoped_comptr.h",
615     "win/scoped_gdi_object.h",
616     "win/scoped_handle.cc",
617     "win/scoped_handle.h",
618     "win/scoped_hdc.h",
619     "win/scoped_hglobal.h",
620     "win/scoped_process_information.cc",
621     "win/scoped_process_information.h",
622     "win/scoped_propvariant.h",
623     "win/scoped_select_object.h",
624     "win/scoped_variant.cc",
625     "win/scoped_variant.h",
626     "win/shortcut.cc",
627     "win/shortcut.h",
628     "win/startup_information.cc",
629     "win/startup_information.h",
630     "win/win_util.cc",
631     "win/win_util.h",
632     "win/windows_version.cc",
633     "win/windows_version.h",
634     "win/wrapped_window_proc.cc",
635     "win/wrapped_window_proc.h",
636   ]
638   sources -= [
639     "sys_info_freebsd.cc",
640     "sys_info_openbsd.cc",
641   ]
643   configs += [ ":base_implementation" ]
645   deps = [
646     ":base_static",
647     "//base/allocator:allocator_extension_thunks",
648     "//base/third_party/dynamic_annotations",
649     "//third_party/modp_b64",
650   ]
652   public_deps = [
653     ":base_paths",
654     "//base/debug",
655     "//base/json",
656     "//base/memory",
657     "//base/metrics",
658     "//base/process",
659     "//base/trace_event",
660   ]
662   # Allow more direct string conversions on platforms with native utf8
663   # strings
664   if (is_mac || is_ios || is_chromeos) {
665     defines = [ "SYSTEM_NATIVE_UTF8" ]
666   }
668   if (is_android) {
669     sources -= [ "power_monitor/power_monitor_device_source_posix.cc" ]
671     # Android uses some Linux sources, put those back.
672     set_sources_assignment_filter([])
673     sources += [
674       "files/file_path_watcher_linux.cc",
675       "posix/unix_domain_socket_linux.cc",
676       "sys_info_linux.cc",
677     ]
678     set_sources_assignment_filter(sources_assignment_filter)
680     deps += [
681       ":base_jni_headers",
682       "//third_party/ashmem",
683       "//third_party/android_tools:cpu_features",
684     ]
686     # logging.cc uses the Android logging library.
687     libs = [ "log" ]
688   }
690   if (is_chromeos) {
691     sources -= [ "power_monitor/power_monitor_device_source_posix.cc" ]
692   }
694   if (is_nacl) {
695     # We reset sources_assignment_filter in order to explicitly include
696     # the linux file (which would otherwise be filtered out).
697     set_sources_assignment_filter([])
698     sources += [
699       "files/file_path_watcher_stub.cc",
700       "sync_socket_nacl.cc",
701       "threading/platform_thread_linux.cc",
702     ]
703     set_sources_assignment_filter(sources_assignment_filter)
705     sources -= [
706       "allocator/type_profiler_control.cc",
707       "allocator/type_profiler_control.h",
708       "async_socket_io_handler_posix.cc",
709       "cpu.cc",
710       "files/file_enumerator_posix.cc",
711       "files/file_proxy.cc",
712       "files/file_util.cc",
713       "files/file_util_posix.cc",
714       "files/file_util_proxy.cc",
715       "files/important_file_writer.cc",
716       "files/important_file_writer.h",
717       "files/scoped_temp_dir.cc",
718       "message_loop/message_pump_libevent.cc",
719       "native_library_posix.cc",
720       "path_service.cc",
721       "rand_util_posix.cc",
722       "scoped_native_library.cc",
723       "sync_socket_posix.cc",
724       "sys_info.cc",
725       "sys_info_posix.cc",
726     ]
727   } else {
728     # Remove NaCl stuff.
729     sources -= [
730       "os_compat_nacl.cc",
731       "os_compat_nacl.h",
732       "rand_util_nacl.cc",
733     ]
734   }
736   # Windows.
737   if (is_win) {
738     sources -= [
739       "message_loop/message_pump_libevent.cc",
740       "strings/string16.cc",
742       # Not using sha1_win.cc because it may have caused a
743       # regression to page cycler moz.
744       "sha1_win.cc",
745     ]
747     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
748     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
750     libs = [
751       "cfgmgr32.lib",
752       "netapi32.lib",
753       "powrprof.lib",
754       "setupapi.lib",
755     ]
756     all_dependent_configs = [ ":base_win_linker_flags" ]
757   } else if (!is_nacl) {
758     # Non-Windows.
759     deps += [ "//third_party/libevent" ]
760   }
762   # Mac.
763   if (is_mac) {
764     sources -= [
765       "native_library_posix.cc",
766       "strings/sys_string_conversions_posix.cc",
767       "threading/platform_thread_internal_posix.cc",
768     ]
769   } else {
770     # Non-Mac.
771     sources -= [
772       "files/file_path_watcher_fsevents.cc",
773       "files/file_path_watcher_fsevents.h",
774       "files/file_path_watcher_kqueue.cc",
775       "files/file_path_watcher_kqueue.h",
776     ]
777   }
779   # Linux.
780   if (is_linux) {
781     # TODO(brettw) this will need to be parameterized at some point.
782     linux_configs = []
783     if (use_glib) {
784       linux_configs += [ "//build/config/linux:glib" ]
785     }
787     configs += linux_configs
788     all_dependent_configs = linux_configs
790     # These dependencies are not required on Android, and in the case
791     # of xdg_mime must be excluded due to licensing restrictions.
792     deps += [
793       "//base/third_party/xdg_mime",
794       "//base/third_party/xdg_user_dirs",
795     ]
796   } else {
797     # Non-Linux.
798     sources -= [
799       "nix/mime_util_xdg.cc",
800       "nix/mime_util_xdg.h",
801       "nix/xdg_util.cc",
802       "nix/xdg_util.h",
803     ]
805     if (!is_android) {
806       sources -= [
807         "linux_util.cc",
808         "linux_util.h",
809       ]
810     }
811   }
813   if (!use_glib) {
814     sources -= [
815       "message_loop/message_pump_glib.cc",
816       "message_loop/message_pump_glib.h",
817     ]
818   }
820   configs += [ "//build/config/compiler:wexit_time_destructors" ]
821   if (is_android && !is_debug) {
822     configs -= [ "//build/config/compiler:optimize" ]
823     configs += [ "//build/config/compiler:optimize_max" ]
824   }
826   allow_circular_includes_from = public_deps
829 # This is the subset of files from base that should not be used with a dynamic
830 # library. Note that this library cannot depend on base because base depends on
831 # base_static.
832 source_set("base_static") {
833   sources = [
834     "base_switches.cc",
835     "base_switches.h",
836     "win/pe_image.cc",
837     "win/pe_image.h",
838   ]
840   if (is_android && !is_debug) {
841     configs -= [ "//build/config/compiler:optimize" ]
842     configs += [ "//build/config/compiler:optimize_max" ]
843   }
846 component("i18n") {
847   output_name = "base_i18n"
848   sources = [
849     "i18n/base_i18n_export.h",
850     "i18n/bidi_line_iterator.cc",
851     "i18n/bidi_line_iterator.h",
852     "i18n/break_iterator.cc",
853     "i18n/break_iterator.h",
854     "i18n/case_conversion.cc",
855     "i18n/case_conversion.h",
856     "i18n/char_iterator.cc",
857     "i18n/char_iterator.h",
858     "i18n/file_util_icu.cc",
859     "i18n/file_util_icu.h",
860     "i18n/i18n_constants.cc",
861     "i18n/i18n_constants.h",
862     "i18n/icu_encoding_detection.cc",
863     "i18n/icu_encoding_detection.h",
864     "i18n/icu_string_conversions.cc",
865     "i18n/icu_string_conversions.h",
866     "i18n/icu_util.cc",
867     "i18n/icu_util.h",
868     "i18n/number_formatting.cc",
869     "i18n/number_formatting.h",
870     "i18n/rtl.cc",
871     "i18n/rtl.h",
872     "i18n/streaming_utf8_validator.cc",
873     "i18n/streaming_utf8_validator.h",
874     "i18n/string_compare.cc",
875     "i18n/string_compare.h",
876     "i18n/string_search.cc",
877     "i18n/string_search.h",
878     "i18n/time_formatting.cc",
879     "i18n/time_formatting.h",
880     "i18n/timezone.cc",
881     "i18n/timezone.h",
882     "i18n/utf8_validator_tables.cc",
883     "i18n/utf8_validator_tables.h",
884   ]
885   defines = [ "BASE_I18N_IMPLEMENTATION" ]
886   configs += [ "//build/config/compiler:wexit_time_destructors" ]
887   deps = [
888     ":base",
889     "//base/third_party/dynamic_annotations",
890     "//third_party/icu",
891   ]
893   if (is_android && !is_debug) {
894     configs -= [ "//build/config/compiler:optimize" ]
895     configs += [ "//build/config/compiler:optimize_max" ]
896   }
898   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
899   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
902 if (is_win || (is_linux && !is_chromeos)) {
903   # TODO(GYP): Figure out which of these work and are needed on other platforms.
904   test("base_perftests") {
905     sources = [
906       "message_loop/message_pump_perftest.cc",
908       # "test/run_all_unittests.cc",
909       "threading/thread_perftest.cc",
910     ]
911     deps = [
912       ":base",
913       "//base/test:test_support",
914       "//base/test:test_support_perf",
915       "//testing/perf",
916       "//testing/gtest",
917     ]
919     if (is_android) {
920       deps += [ "//testing/android/native_test:native_test_native_code" ]
921     }
922   }
924   test("base_i18n_perftests") {
925     sources = [
926       "i18n/streaming_utf8_validator_perftest.cc",
927     ]
928     deps = [
929       ":base",
930       ":i18n",
931       "//base/test:test_support",
932       "//base/test:test_support_perf",
933       "//testing/gtest",
934     ]
935   }
937   if (!is_ios) {
938     executable("build_utf8_validator_tables") {
939       sources = [
940         "i18n/build_utf8_validator_tables.cc",
941       ]
942       deps = [
943         ":base",
944         "//third_party/icu:icuuc",
945       ]
946     }
948     executable("check_example") {
949       sources = [
950         "check_example.cc",
951       ]
952       deps = [
953         ":base",
954       ]
955     }
956   }
959 component("prefs") {
960   sources = [
961     "prefs/base_prefs_export.h",
962     "prefs/default_pref_store.cc",
963     "prefs/default_pref_store.h",
964     "prefs/json_pref_store.cc",
965     "prefs/json_pref_store.h",
966     "prefs/overlay_user_pref_store.cc",
967     "prefs/overlay_user_pref_store.h",
968     "prefs/persistent_pref_store.h",
969     "prefs/pref_change_registrar.cc",
970     "prefs/pref_change_registrar.h",
971     "prefs/pref_filter.h",
972     "prefs/pref_member.cc",
973     "prefs/pref_member.h",
974     "prefs/pref_notifier.h",
975     "prefs/pref_notifier_impl.cc",
976     "prefs/pref_notifier_impl.h",
977     "prefs/pref_observer.h",
978     "prefs/pref_registry.cc",
979     "prefs/pref_registry.h",
980     "prefs/pref_registry_simple.cc",
981     "prefs/pref_registry_simple.h",
982     "prefs/pref_service.cc",
983     "prefs/pref_service.h",
984     "prefs/pref_service_factory.cc",
985     "prefs/pref_service_factory.h",
986     "prefs/pref_store.cc",
987     "prefs/pref_store.h",
988     "prefs/pref_value_map.cc",
989     "prefs/pref_value_map.h",
990     "prefs/pref_value_store.cc",
991     "prefs/pref_value_store.h",
992     "prefs/scoped_user_pref_update.cc",
993     "prefs/scoped_user_pref_update.h",
994     "prefs/value_map_pref_store.cc",
995     "prefs/value_map_pref_store.h",
996     "prefs/writeable_pref_store.h",
997   ]
999   defines = [ "BASE_PREFS_IMPLEMENTATION" ]
1001   deps = [
1002     ":base",
1003   ]
1005   if (is_android && !is_debug) {
1006     configs -= [ "//build/config/compiler:optimize" ]
1007     configs += [ "//build/config/compiler:optimize_max" ]
1008   }
1011 source_set("prefs_test_support") {
1012   testonly = true
1013   sources = [
1014     "prefs/mock_pref_change_callback.cc",
1015     "prefs/mock_pref_change_callback.h",
1016     "prefs/pref_store_observer_mock.cc",
1017     "prefs/pref_store_observer_mock.h",
1018     "prefs/testing_pref_service.cc",
1019     "prefs/testing_pref_service.h",
1020     "prefs/testing_pref_store.cc",
1021     "prefs/testing_pref_store.h",
1022   ]
1024   public_deps = [
1025     ":prefs",
1026   ]
1027   deps = [
1028     ":base",
1029     "//testing/gmock",
1030     "//testing/gtest",
1031   ]
1034 source_set("message_loop_tests") {
1035   testonly = true
1036   sources = [
1037     "message_loop/message_loop_test.cc",
1038     "message_loop/message_loop_test.h",
1039   ]
1041   deps = [
1042     ":base",
1043     "//testing/gtest",
1044   ]
1047 if (is_win) {
1048   # Target to manually rebuild pe_image_test.dll which is checked into
1049   # base/test/data/pe_image.
1050   shared_library("pe_image_test") {
1051     sources = [
1052       "win/pe_image_test.cc",
1053     ]
1054     ldflags = [
1055       "/DELAYLOAD:cfgmgr32.dll",
1056       "/DELAYLOAD:shell32.dll",
1057       "/SUBSYSTEM:WINDOWS",
1058     ]
1059     libs = [
1060       "cfgmgr32.lib",
1061       "shell32.lib",
1062     ]
1063   }
1066 test("base_unittests") {
1067   sources = [
1068     "android/application_status_listener_unittest.cc",
1069     "android/content_uri_utils_unittest.cc",
1070     "android/jni_android_unittest.cc",
1071     "android/jni_array_unittest.cc",
1072     "android/jni_string_unittest.cc",
1073     "android/library_loader/library_prefetcher_unittest.cc",
1074     "android/path_utils_unittest.cc",
1075     "android/scoped_java_ref_unittest.cc",
1076     "android/sys_utils_unittest.cc",
1077     "async_socket_io_handler_unittest.cc",
1078     "at_exit_unittest.cc",
1079     "atomicops_unittest.cc",
1080     "barrier_closure_unittest.cc",
1081     "base64_unittest.cc",
1082     "big_endian_unittest.cc",
1083     "bind_unittest.cc",
1084     "bind_unittest.nc",
1085     "bits_unittest.cc",
1086     "build_time_unittest.cc",
1087     "callback_helpers_unittest.cc",
1088     "callback_list_unittest.cc",
1089     "callback_list_unittest.nc",
1090     "callback_unittest.cc",
1091     "callback_unittest.nc",
1092     "cancelable_callback_unittest.cc",
1093     "chromeos/memory_pressure_monitor_chromeos_unittest.cc",
1094     "command_line_unittest.cc",
1095     "containers/adapters_unittest.cc",
1096     "containers/hash_tables_unittest.cc",
1097     "containers/linked_list_unittest.cc",
1098     "containers/mru_cache_unittest.cc",
1099     "containers/scoped_ptr_hash_map_unittest.cc",
1100     "containers/small_map_unittest.cc",
1101     "containers/stack_container_unittest.cc",
1102     "cpu_unittest.cc",
1103     "debug/crash_logging_unittest.cc",
1104     "debug/debugger_unittest.cc",
1105     "debug/leak_tracker_unittest.cc",
1106     "debug/proc_maps_linux_unittest.cc",
1107     "debug/stack_trace_unittest.cc",
1108     "debug/task_annotator_unittest.cc",
1109     "deferred_sequenced_task_runner_unittest.cc",
1110     "environment_unittest.cc",
1111     "file_version_info_unittest.cc",
1112     "files/dir_reader_posix_unittest.cc",
1113     "files/file_path_unittest.cc",
1114     "files/file_path_watcher_unittest.cc",
1115     "files/file_proxy_unittest.cc",
1116     "files/file_unittest.cc",
1117     "files/file_util_proxy_unittest.cc",
1118     "files/file_util_unittest.cc",
1119     "files/important_file_writer_unittest.cc",
1120     "files/scoped_temp_dir_unittest.cc",
1121     "gmock_unittest.cc",
1122     "guid_unittest.cc",
1123     "hash_unittest.cc",
1124     "i18n/break_iterator_unittest.cc",
1125     "i18n/case_conversion_unittest.cc",
1126     "i18n/char_iterator_unittest.cc",
1127     "i18n/file_util_icu_unittest.cc",
1128     "i18n/icu_string_conversions_unittest.cc",
1129     "i18n/number_formatting_unittest.cc",
1130     "i18n/rtl_unittest.cc",
1131     "i18n/streaming_utf8_validator_unittest.cc",
1132     "i18n/string_search_unittest.cc",
1133     "i18n/time_formatting_unittest.cc",
1134     "i18n/timezone_unittest.cc",
1135     "id_map_unittest.cc",
1136     "ios/device_util_unittest.mm",
1137     "ios/weak_nsobject_unittest.mm",
1138     "json/json_parser_unittest.cc",
1139     "json/json_reader_unittest.cc",
1140     "json/json_value_converter_unittest.cc",
1141     "json/json_value_serializer_unittest.cc",
1142     "json/json_writer_unittest.cc",
1143     "json/string_escape_unittest.cc",
1144     "lazy_instance_unittest.cc",
1145     "logging_unittest.cc",
1146     "mac/bind_objc_block_unittest.mm",
1147     "mac/foundation_util_unittest.mm",
1148     "mac/libdispatch_task_runner_unittest.cc",
1149     "mac/mac_util_unittest.mm",
1150     "mac/objc_property_releaser_unittest.mm",
1151     "mac/scoped_nsobject_unittest.mm",
1152     "mac/scoped_objc_class_swizzler_unittest.mm",
1153     "mac/scoped_sending_event_unittest.mm",
1154     "md5_unittest.cc",
1155     "memory/aligned_memory_unittest.cc",
1156     "memory/discardable_shared_memory_unittest.cc",
1157     "memory/linked_ptr_unittest.cc",
1158     "memory/ref_counted_memory_unittest.cc",
1159     "memory/ref_counted_unittest.cc",
1160     "memory/scoped_ptr_unittest.cc",
1161     "memory/scoped_ptr_unittest.nc",
1162     "memory/scoped_vector_unittest.cc",
1163     "memory/shared_memory_unittest.cc",
1164     "memory/singleton_unittest.cc",
1165     "memory/weak_ptr_unittest.cc",
1166     "memory/weak_ptr_unittest.nc",
1167     "message_loop/message_loop_proxy_impl_unittest.cc",
1168     "message_loop/message_loop_proxy_unittest.cc",
1169     "message_loop/message_loop_unittest.cc",
1170     "message_loop/message_pump_glib_unittest.cc",
1171     "message_loop/message_pump_io_ios_unittest.cc",
1172     "metrics/bucket_ranges_unittest.cc",
1173     "metrics/field_trial_unittest.cc",
1174     "metrics/histogram_base_unittest.cc",
1175     "metrics/histogram_delta_serialization_unittest.cc",
1176     "metrics/histogram_snapshot_manager_unittest.cc",
1177     "metrics/histogram_unittest.cc",
1178     "metrics/sample_map_unittest.cc",
1179     "metrics/sample_vector_unittest.cc",
1180     "metrics/sparse_histogram_unittest.cc",
1181     "metrics/statistics_recorder_unittest.cc",
1182     "move_unittest.cc",
1183     "numerics/safe_numerics_unittest.cc",
1184     "observer_list_unittest.cc",
1185     "os_compat_android_unittest.cc",
1186     "path_service_unittest.cc",
1187     "pickle_unittest.cc",
1188     "posix/file_descriptor_shuffle_unittest.cc",
1189     "posix/unix_domain_socket_linux_unittest.cc",
1190     "power_monitor/power_monitor_unittest.cc",
1191     "prefs/default_pref_store_unittest.cc",
1192     "prefs/json_pref_store_unittest.cc",
1193     "prefs/overlay_user_pref_store_unittest.cc",
1194     "prefs/pref_change_registrar_unittest.cc",
1195     "prefs/pref_member_unittest.cc",
1196     "prefs/pref_notifier_impl_unittest.cc",
1197     "prefs/pref_service_unittest.cc",
1198     "prefs/pref_value_map_unittest.cc",
1199     "prefs/pref_value_store_unittest.cc",
1200     "prefs/scoped_user_pref_update_unittest.cc",
1201     "process/memory_unittest.cc",
1202     "process/memory_unittest_mac.h",
1203     "process/memory_unittest_mac.mm",
1204     "process/process_metrics_unittest.cc",
1205     "process/process_metrics_unittest_ios.cc",
1206     "process/process_unittest.cc",
1207     "process/process_util_unittest.cc",
1208     "process/process_util_unittest_ios.cc",
1209     "profiler/stack_sampling_profiler_unittest.cc",
1210     "profiler/tracked_time_unittest.cc",
1211     "rand_util_unittest.cc",
1212     "scoped_clear_errno_unittest.cc",
1213     "scoped_generic_unittest.cc",
1214     "scoped_native_library_unittest.cc",
1215     "security_unittest.cc",
1216     "sequence_checker_unittest.cc",
1217     "sha1_unittest.cc",
1218     "stl_util_unittest.cc",
1219     "strings/nullable_string16_unittest.cc",
1220     "strings/safe_sprintf_unittest.cc",
1221     "strings/string16_unittest.cc",
1222     "strings/string_number_conversions_unittest.cc",
1223     "strings/string_piece_unittest.cc",
1224     "strings/string_split_unittest.cc",
1225     "strings/string_tokenizer_unittest.cc",
1226     "strings/string_util_unittest.cc",
1227     "strings/stringize_macros_unittest.cc",
1228     "strings/stringprintf_unittest.cc",
1229     "strings/sys_string_conversions_mac_unittest.mm",
1230     "strings/sys_string_conversions_unittest.cc",
1231     "strings/utf_offset_string_conversions_unittest.cc",
1232     "strings/utf_string_conversions_unittest.cc",
1233     "supports_user_data_unittest.cc",
1234     "sync_socket_unittest.cc",
1235     "synchronization/cancellation_flag_unittest.cc",
1236     "synchronization/condition_variable_unittest.cc",
1237     "synchronization/lock_unittest.cc",
1238     "synchronization/waitable_event_unittest.cc",
1239     "synchronization/waitable_event_watcher_unittest.cc",
1240     "sys_info_unittest.cc",
1241     "system_monitor/system_monitor_unittest.cc",
1242     "task/cancelable_task_tracker_unittest.cc",
1243     "task_runner_util_unittest.cc",
1244     "template_util_unittest.cc",
1245     "test/expectations/expectation_unittest.cc",
1246     "test/expectations/parser_unittest.cc",
1247     "test/histogram_tester_unittest.cc",
1248     "test/test_reg_util_win_unittest.cc",
1249     "test/trace_event_analyzer_unittest.cc",
1250     "test/user_action_tester_unittest.cc",
1251     "threading/non_thread_safe_unittest.cc",
1252     "threading/platform_thread_unittest.cc",
1253     "threading/sequenced_worker_pool_unittest.cc",
1254     "threading/simple_thread_unittest.cc",
1255     "threading/thread_checker_unittest.cc",
1256     "threading/thread_collision_warner_unittest.cc",
1257     "threading/thread_id_name_manager_unittest.cc",
1258     "threading/thread_local_storage_unittest.cc",
1259     "threading/thread_local_unittest.cc",
1260     "threading/thread_unittest.cc",
1261     "threading/watchdog_unittest.cc",
1262     "threading/worker_pool_posix_unittest.cc",
1263     "threading/worker_pool_unittest.cc",
1264     "time/pr_time_unittest.cc",
1265     "time/time_unittest.cc",
1266     "time/time_win_unittest.cc",
1267     "timer/hi_res_timer_manager_unittest.cc",
1268     "timer/mock_timer_unittest.cc",
1269     "timer/timer_unittest.cc",
1270     "tools_sanity_unittest.cc",
1271     "tracked_objects_unittest.cc",
1272     "tuple_unittest.cc",
1273     "values_unittest.cc",
1274     "version_unittest.cc",
1275     "vlog_unittest.cc",
1276     "win/dllmain.cc",
1277     "win/enum_variant_unittest.cc",
1278     "win/event_trace_consumer_unittest.cc",
1279     "win/event_trace_controller_unittest.cc",
1280     "win/event_trace_provider_unittest.cc",
1281     "win/i18n_unittest.cc",
1282     "win/iunknown_impl_unittest.cc",
1283     "win/message_window_unittest.cc",
1284     "win/object_watcher_unittest.cc",
1285     "win/pe_image_unittest.cc",
1286     "win/registry_unittest.cc",
1287     "win/scoped_bstr_unittest.cc",
1288     "win/scoped_comptr_unittest.cc",
1289     "win/scoped_process_information_unittest.cc",
1290     "win/scoped_variant_unittest.cc",
1291     "win/shortcut_unittest.cc",
1292     "win/startup_information_unittest.cc",
1293     "win/win_util_unittest.cc",
1294     "win/wrapped_window_proc_unittest.cc",
1295   ]
1297   deps = [
1298     ":base",
1299     ":i18n",
1300     ":message_loop_tests",
1301     ":prefs",
1302     ":prefs_test_support",
1303     "//base/allocator",
1304     "//base/test:run_all_unittests",
1305     "//base/test:test_support",
1306     "//base/third_party/dynamic_annotations",
1307     "//base/trace_event:trace_event_unittests",
1308     "//testing/gmock",
1309     "//testing/gtest",
1310     "//third_party/icu",
1311   ]
1313   # Allow more direct string conversions on platforms with native utf8
1314   # strings
1315   if (is_mac || is_ios || is_chromeos) {
1316     defines = [ "SYSTEM_NATIVE_UTF8" ]
1317   }
1319   if (is_android) {
1320     apk_deps = [
1321       ":base_java",
1322       ":base_java_unittest_support",
1323     ]
1324   }
1326   if (is_ios) {
1327     sources -= [
1328       "process/memory_unittest.cc",
1329       "process/memory_unittest_mac.h",
1330       "process/memory_unittest_mac.mm",
1331       "process/process_unittest.cc",
1332       "process/process_util_unittest.cc",
1333     ]
1335     # Pull in specific Mac files for iOS (which have been filtered out by file
1336     # name rules).
1337     set_sources_assignment_filter([])
1338     sources += [
1339       "mac/bind_objc_block_unittest.mm",
1340       "mac/foundation_util_unittest.mm",
1341       "mac/objc_property_releaser_unittest.mm",
1342       "mac/scoped_nsobject_unittest.mm",
1343       "sys_string_conversions_mac_unittest.mm",
1344     ]
1345     set_sources_assignment_filter(sources_assignment_filter)
1347     # TODO(GYP): dep on copy_test_data_ios action.
1348   }
1350   if (is_linux) {
1351     sources -= [ "file_version_info_unittest.cc" ]
1352     sources += [ "nix/xdg_util_unittest.cc" ]
1353     deps += [ "//base/test:malloc_wrapper" ]
1355     if (use_glib) {
1356       configs += [ "//build/config/linux:glib" ]
1357     }
1358   }
1360   if (!is_linux || use_ozone) {
1361     sources -= [ "message_loop/message_pump_glib_unittest.cc" ]
1362   }
1364   if (is_posix || is_ios) {
1365     sources += [ "message_loop/message_pump_libevent_unittest.cc" ]
1366     deps += [ "//third_party/libevent" ]
1367   }
1369   if (is_android) {
1370     deps += [ "//testing/android/native_test:native_test_native_code" ]
1371     set_sources_assignment_filter([])
1372     sources += [ "debug/proc_maps_linux_unittest.cc" ]
1373     set_sources_assignment_filter(sources_assignment_filter)
1374   }
1376   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1377   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1380 if (is_android) {
1381   # GYP: //base.gyp:base_jni_headers
1382   generate_jni("base_jni_headers") {
1383     sources = [
1384       "android/java/src/org/chromium/base/AnimationFrameTimeHistogram.java",
1385       "android/java/src/org/chromium/base/ApplicationStatus.java",
1386       "android/java/src/org/chromium/base/BuildInfo.java",
1387       "android/java/src/org/chromium/base/CommandLine.java",
1388       "android/java/src/org/chromium/base/ContentUriUtils.java",
1389       "android/java/src/org/chromium/base/CpuFeatures.java",
1390       "android/java/src/org/chromium/base/EventLog.java",
1391       "android/java/src/org/chromium/base/FieldTrialList.java",
1392       "android/java/src/org/chromium/base/ImportantFileWriterAndroid.java",
1393       "android/java/src/org/chromium/base/JNIUtils.java",
1394       "android/java/src/org/chromium/base/JavaHandlerThread.java",
1395       "android/java/src/org/chromium/base/LocaleUtils.java",
1396       "android/java/src/org/chromium/base/MemoryPressureListener.java",
1397       "android/java/src/org/chromium/base/PathService.java",
1398       "android/java/src/org/chromium/base/PathUtils.java",
1399       "android/java/src/org/chromium/base/PowerMonitor.java",
1400       "android/java/src/org/chromium/base/SysUtils.java",
1401       "android/java/src/org/chromium/base/SystemMessageHandler.java",
1402       "android/java/src/org/chromium/base/ThreadUtils.java",
1403       "android/java/src/org/chromium/base/TraceEvent.java",
1404       "android/java/src/org/chromium/base/library_loader/LibraryLoader.java",
1405       "android/java/src/org/chromium/base/metrics/RecordHistogram.java",
1406       "android/java/src/org/chromium/base/metrics/RecordUserAction.java",
1407     ]
1409     deps = [
1410       ":android_runtime_jni_headers",
1411     ]
1413     jni_package = "base"
1414   }
1416   # GYP: //base.gyp:android_runtime_jni_headers
1417   generate_jar_jni("android_runtime_jni_headers") {
1418     jni_package = "base"
1419     classes = [ "java/lang/Runtime.class" ]
1420   }
1422   # GYP: //base.gyp:base_java
1423   android_library("base_java") {
1424     srcjar_deps = [
1425       ":base_android_java_enums_srcjar",
1426       ":base_native_libraries_gen",
1427     ]
1429     deps = [
1430       "//third_party/jsr-305:jsr_305_javalib",
1431     ]
1433     DEPRECATED_java_in_dir = "android/java/src"
1435     # A new version of NativeLibraries.java (with the actual correct values)
1436     # will be created when creating an apk.
1437     jar_excluded_patterns = [
1438       "*/NativeLibraries.class",
1439       "*/NativeLibraries##*.class",
1440     ]
1441   }
1443   # GYP: //base.gyp:base_javatests
1444   android_library("base_javatests") {
1445     deps = [
1446       ":base_java",
1447       ":base_java_test_support",
1448     ]
1449     DEPRECATED_java_in_dir = "android/javatests/src"
1450   }
1452   # GYP: //base.gyp:base_java_test_support
1453   android_library("base_java_test_support") {
1454     deps = [
1455       ":base_java",
1456       "//testing/android/reporter:reporter_java",
1457     ]
1458     DEPRECATED_java_in_dir = "test/android/javatests/src"
1459   }
1461   # GYP: //base.gyp:base_junit_tests
1462   junit_binary("base_junit_tests") {
1463     java_files = [ "android/junit/src/org/chromium/base/LogTest.java" ]
1464     deps = [
1465       ":base_java",
1466       ":base_java_test_support",
1467     ]
1468   }
1470   # GYP: //base.gyp:base_java_application_state
1471   # GYP: //base.gyp:base_java_library_load_from_apk_status_codes
1472   # GYP: //base.gyp:base_java_library_process_type
1473   # GYP: //base.gyp:base_java_memory_pressure_level
1474   java_cpp_enum("base_android_java_enums_srcjar") {
1475     sources = [
1476       "android/application_status_listener.h",
1477       "android/library_loader/library_load_from_apk_status_codes.h",
1478       "android/library_loader/library_loader_hooks.h",
1479       "memory/memory_pressure_listener.h",
1480     ]
1481     outputs = [
1482       "org/chromium/base/ApplicationState.java",
1483       "org/chromium/base/library_loader/LibraryLoadFromApkStatusCodes.java",
1484       "org/chromium/base/library_loader/LibraryProcessType.java",
1485       "org/chromium/base/MemoryPressureLevel.java",
1486     ]
1487   }
1489   # GYP: //base/base.gyp:base_native_libraries_gen
1490   java_cpp_template("base_native_libraries_gen") {
1491     sources = [
1492       "android/java/templates/NativeLibraries.template",
1493     ]
1494     package_name = "org/chromium/base/library_loader"
1495   }
1497   # GYP: //base.gyp:base_java_unittest_support
1498   android_library("base_java_unittest_support") {
1499     deps = [
1500       ":base_java",
1501     ]
1502     java_files =
1503         [ "test/android/java/src/org/chromium/base/ContentUriTestUtils.java" ]
1504   }