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