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