Add google_apis_unittests, midi_unittests to GN swarming.
[chromium-blink-merge.git] / base / BUILD.gn
blobb6fb63eda7224a74168ba28a113d25ded6daeb26
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/cxa_demangle_stub.cc",
87     "android/event_log.cc",
88     "android/event_log.h",
89     "android/field_trial_list.cc",
90     "android/field_trial_list.h",
91     "android/fifo_utils.cc",
92     "android/fifo_utils.h",
93     "android/important_file_writer_android.cc",
94     "android/important_file_writer_android.h",
95     "android/java_handler_thread.cc",
96     "android/java_handler_thread.h",
97     "android/java_runtime.cc",
98     "android/java_runtime.h",
99     "android/jni_android.cc",
100     "android/jni_android.h",
101     "android/jni_array.cc",
102     "android/jni_array.h",
103     "android/jni_registrar.cc",
104     "android/jni_registrar.h",
105     "android/jni_string.cc",
106     "android/jni_string.h",
107     "android/jni_utils.cc",
108     "android/jni_utils.h",
109     "android/jni_weak_ref.cc",
110     "android/jni_weak_ref.h",
111     "android/library_loader/library_load_from_apk_status_codes.h",
112     "android/library_loader/library_loader_hooks.cc",
113     "android/library_loader/library_loader_hooks.h",
114     "android/library_loader/library_prefetcher.cc",
115     "android/library_loader/library_prefetcher.h",
116     "android/locale_utils.cc",
117     "android/locale_utils.h",
118     "android/memory_pressure_listener_android.cc",
119     "android/memory_pressure_listener_android.h",
120     "android/path_service_android.cc",
121     "android/path_service_android.h",
122     "android/path_utils.cc",
123     "android/path_utils.h",
124     "android/record_histogram.cc",
125     "android/record_histogram.h",
126     "android/record_user_action.cc",
127     "android/record_user_action.h",
128     "android/scoped_java_ref.cc",
129     "android/scoped_java_ref.h",
130     "android/sys_utils.cc",
131     "android/sys_utils.h",
132     "android/thread_utils.h",
133     "android/trace_event_binding.cc",
134     "android/trace_event_binding.h",
135     "async_socket_io_handler.h",
136     "async_socket_io_handler_posix.cc",
137     "async_socket_io_handler_win.cc",
138     "at_exit.cc",
139     "at_exit.h",
140     "atomic_ref_count.h",
141     "atomic_sequence_num.h",
142     "atomicops.h",
143     "atomicops_internals_mac.h",
144     "atomicops_internals_portable.h",
145     "atomicops_internals_x86_msvc.h",
146     "auto_reset.h",
147     "barrier_closure.cc",
148     "barrier_closure.h",
149     "base64.cc",
150     "base64.h",
151     "base_export.h",
152     "base_switches.h",
153     "basictypes.h",
154     "big_endian.cc",
155     "big_endian.h",
156     "bind.h",
157     "bind_helpers.cc",
158     "bind_helpers.h",
159     "bind_internal.h",
160     "bind_internal_win.h",
161     "bits.h",
162     "build_time.cc",
163     "build_time.h",
164     "callback.h",
165     "callback_helpers.cc",
166     "callback_helpers.h",
167     "callback_internal.cc",
168     "callback_internal.h",
169     "cancelable_callback.h",
170     "command_line.cc",
171     "command_line.h",
172     "compiler_specific.h",
173     "containers/adapters.h",
174     "containers/hash_tables.h",
175     "containers/linked_list.h",
176     "containers/mru_cache.h",
177     "containers/scoped_ptr_hash_map.h",
178     "containers/scoped_ptr_map.h",
179     "containers/small_map.h",
180     "containers/stack_container.h",
181     "cpu.cc",
182     "cpu.h",
183     "critical_closure.h",
184     "critical_closure_internal_ios.mm",
185     "deferred_sequenced_task_runner.cc",
186     "deferred_sequenced_task_runner.h",
187     "environment.cc",
188     "environment.h",
189     "file_descriptor_posix.h",
190     "file_version_info.h",
191     "file_version_info_mac.h",
192     "file_version_info_mac.mm",
193     "file_version_info_win.cc",
194     "file_version_info_win.h",
195     "files/dir_reader_fallback.h",
196     "files/dir_reader_linux.h",
197     "files/dir_reader_posix.h",
198     "files/file.cc",
199     "files/file_enumerator.cc",
200     "files/file_enumerator.h",
201     "files/file_enumerator_posix.cc",
202     "files/file_enumerator_win.cc",
203     "files/file_path.cc",
204     "files/file_path.h",
205     "files/file_path_constants.cc",
206     "files/file_path_watcher.cc",
207     "files/file_path_watcher.h",
208     "files/file_path_watcher_fsevents.cc",
209     "files/file_path_watcher_fsevents.h",
210     "files/file_path_watcher_kqueue.cc",
211     "files/file_path_watcher_kqueue.h",
212     "files/file_path_watcher_linux.cc",
213     "files/file_path_watcher_mac.cc",
214     "files/file_path_watcher_win.cc",
215     "files/file_posix.cc",
216     "files/file_proxy.cc",
217     "files/file_proxy.h",
218     "files/file_tracing.cc",
219     "files/file_tracing.h",
220     "files/file_util.cc",
221     "files/file_util.h",
222     "files/file_util_android.cc",
223     "files/file_util_linux.cc",
224     "files/file_util_mac.mm",
225     "files/file_util_posix.cc",
226     "files/file_util_proxy.cc",
227     "files/file_util_proxy.h",
228     "files/file_util_win.cc",
229     "files/file_win.cc",
230     "files/important_file_writer.cc",
231     "files/important_file_writer.h",
232     "files/memory_mapped_file.cc",
233     "files/memory_mapped_file.h",
234     "files/memory_mapped_file_posix.cc",
235     "files/memory_mapped_file_win.cc",
236     "files/scoped_file.cc",
237     "files/scoped_file.h",
238     "files/scoped_temp_dir.cc",
239     "files/scoped_temp_dir.h",
240     "format_macros.h",
241     "gtest_prod_util.h",
242     "guid.cc",
243     "guid.h",
244     "guid_posix.cc",
245     "guid_win.cc",
246     "hash.cc",
247     "hash.h",
248     "id_map.h",
249     "ios/crb_protocol_observers.h",
250     "ios/crb_protocol_observers.mm",
251     "ios/device_util.h",
252     "ios/device_util.mm",
253     "ios/ios_util.h",
254     "ios/ios_util.mm",
255     "ios/ns_error_util.h",
256     "ios/ns_error_util.mm",
257     "ios/scoped_critical_action.h",
258     "ios/scoped_critical_action.mm",
259     "ios/weak_nsobject.h",
260     "ios/weak_nsobject.mm",
261     "lazy_instance.cc",
262     "lazy_instance.h",
263     "linux_util.cc",
264     "linux_util.h",
265     "location.cc",
266     "location.h",
267     "logging.cc",
268     "logging.h",
269     "logging_win.cc",
270     "logging_win.h",
271     "mac/authorization_util.h",
272     "mac/authorization_util.mm",
273     "mac/bind_objc_block.h",
274     "mac/bundle_locations.h",
275     "mac/bundle_locations.mm",
276     "mac/call_with_eh_frame.cc",
277     "mac/call_with_eh_frame.h",
278     "mac/call_with_eh_frame_asm.S",
279     "mac/cocoa_protocols.h",
280     "mac/dispatch_source_mach.cc",
281     "mac/dispatch_source_mach.h",
282     "mac/foundation_util.h",
283     "mac/foundation_util.mm",
284     "mac/launch_services_util.cc",
285     "mac/launch_services_util.h",
286     "mac/launchd.cc",
287     "mac/launchd.h",
288     "mac/libdispatch_task_runner.cc",
289     "mac/libdispatch_task_runner.h",
290     "mac/mac_logging.cc",
291     "mac/mac_logging.h",
292     "mac/mac_util.h",
293     "mac/mac_util.mm",
294     "mac/mach_logging.cc",
295     "mac/mach_logging.h",
296     "mac/objc_property_releaser.h",
297     "mac/objc_property_releaser.mm",
298     "mac/os_crash_dumps.cc",
299     "mac/os_crash_dumps.h",
300     "mac/scoped_aedesc.h",
301     "mac/scoped_authorizationref.h",
302     "mac/scoped_block.h",
303     "mac/scoped_cftyperef.h",
304     "mac/scoped_ioobject.h",
305     "mac/scoped_ioplugininterface.h",
306     "mac/scoped_launch_data.h",
307     "mac/scoped_mach_port.cc",
308     "mac/scoped_mach_port.h",
309     "mac/scoped_mach_vm.cc",
310     "mac/scoped_mach_vm.h",
311     "mac/scoped_nsautorelease_pool.h",
312     "mac/scoped_nsautorelease_pool.mm",
313     "mac/scoped_nsobject.h",
314     "mac/scoped_objc_class_swizzler.h",
315     "mac/scoped_objc_class_swizzler.mm",
316     "mac/scoped_sending_event.h",
317     "mac/scoped_sending_event.mm",
318     "mac/sdk_forward_declarations.h",
319     "mac/sdk_forward_declarations.mm",
320     "macros.h",
321     "md5.cc",
322     "md5.h",
323     "message_loop/incoming_task_queue.cc",
324     "message_loop/incoming_task_queue.h",
325     "message_loop/message_loop.cc",
326     "message_loop/message_loop.h",
327     "message_loop/message_loop_task_runner.cc",
328     "message_loop/message_loop_task_runner.h",
329     "message_loop/message_pump.cc",
330     "message_loop/message_pump.h",
331     "message_loop/message_pump_android.cc",
332     "message_loop/message_pump_android.h",
333     "message_loop/message_pump_default.cc",
334     "message_loop/message_pump_default.h",
335     "message_loop/message_pump_glib.cc",
336     "message_loop/message_pump_glib.h",
337     "message_loop/message_pump_io_ios.cc",
338     "message_loop/message_pump_io_ios.h",
339     "message_loop/message_pump_libevent.cc",
340     "message_loop/message_pump_libevent.h",
341     "message_loop/message_pump_mac.h",
342     "message_loop/message_pump_mac.mm",
343     "message_loop/message_pump_win.cc",
344     "message_loop/message_pump_win.h",
345     "move.h",
346     "native_library.h",
347     "native_library_ios.mm",
348     "native_library_mac.mm",
349     "native_library_posix.cc",
350     "native_library_win.cc",
351     "nix/mime_util_xdg.cc",
352     "nix/mime_util_xdg.h",
353     "nix/xdg_util.cc",
354     "nix/xdg_util.h",
355     "numerics/safe_conversions.h",
356     "numerics/safe_conversions_impl.h",
357     "numerics/safe_math.h",
358     "numerics/safe_math_impl.h",
359     "observer_list.h",
360     "observer_list_threadsafe.h",
361     "os_compat_android.cc",
362     "os_compat_android.h",
363     "os_compat_nacl.cc",
364     "os_compat_nacl.h",
365     "path_service.cc",
366     "path_service.h",
367     "pending_task.cc",
368     "pending_task.h",
369     "pickle.cc",
370     "pickle.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/native_stack_sampler_posix.cc",
398     "profiler/native_stack_sampler_win.cc",
399     "profiler/scoped_profile.cc",
400     "profiler/scoped_profile.h",
401     "profiler/scoped_tracker.cc",
402     "profiler/scoped_tracker.h",
403     "profiler/stack_sampling_profiler.cc",
404     "profiler/stack_sampling_profiler.h",
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/pattern.cc",
434     "strings/pattern.h",
435     "strings/safe_sprintf.cc",
436     "strings/safe_sprintf.h",
437     "strings/string16.cc",
438     "strings/string16.h",
439     "strings/string_number_conversions.cc",
440     "strings/string_number_conversions.h",
441     "strings/string_piece.cc",
442     "strings/string_piece.h",
443     "strings/string_split.cc",
444     "strings/string_split.h",
445     "strings/string_tokenizer.h",
446     "strings/string_util.cc",
447     "strings/string_util.h",
448     "strings/string_util_constants.cc",
449     "strings/string_util_posix.h",
450     "strings/string_util_win.h",
451     "strings/stringize_macros.h",
452     "strings/stringprintf.cc",
453     "strings/stringprintf.h",
454     "strings/sys_string_conversions.h",
455     "strings/sys_string_conversions_mac.mm",
456     "strings/sys_string_conversions_posix.cc",
457     "strings/sys_string_conversions_win.cc",
458     "strings/utf_offset_string_conversions.cc",
459     "strings/utf_offset_string_conversions.h",
460     "strings/utf_string_conversion_utils.cc",
461     "strings/utf_string_conversion_utils.h",
462     "strings/utf_string_conversions.cc",
463     "strings/utf_string_conversions.h",
464     "supports_user_data.cc",
465     "supports_user_data.h",
466     "sync_socket.h",
467     "sync_socket_posix.cc",
468     "sync_socket_win.cc",
469     "synchronization/cancellation_flag.cc",
470     "synchronization/cancellation_flag.h",
471     "synchronization/condition_variable.h",
472     "synchronization/condition_variable_posix.cc",
473     "synchronization/condition_variable_win.cc",
474     "synchronization/lock.cc",
475     "synchronization/lock.h",
476     "synchronization/lock_impl.h",
477     "synchronization/lock_impl_posix.cc",
478     "synchronization/lock_impl_win.cc",
479     "synchronization/spin_wait.h",
480     "synchronization/waitable_event.h",
481     "synchronization/waitable_event_posix.cc",
482     "synchronization/waitable_event_watcher.h",
483     "synchronization/waitable_event_watcher_posix.cc",
484     "synchronization/waitable_event_watcher_win.cc",
485     "synchronization/waitable_event_win.cc",
486     "sys_byteorder.h",
487     "sys_info.cc",
488     "sys_info.h",
489     "sys_info_android.cc",
490     "sys_info_chromeos.cc",
491     "sys_info_freebsd.cc",
492     "sys_info_ios.mm",
493     "sys_info_linux.cc",
494     "sys_info_mac.cc",
495     "sys_info_openbsd.cc",
496     "sys_info_posix.cc",
497     "sys_info_win.cc",
498     "system_monitor/system_monitor.cc",
499     "system_monitor/system_monitor.h",
500     "task/cancelable_task_tracker.cc",
501     "task/cancelable_task_tracker.h",
502     "task_runner.cc",
503     "task_runner.h",
504     "task_runner_util.h",
505     "template_util.h",
506     "third_party/dmg_fp/dmg_fp.h",
507     "third_party/dmg_fp/dtoa_wrapper.cc",
508     "third_party/dmg_fp/g_fmt.cc",
509     "third_party/icu/icu_utf.cc",
510     "third_party/icu/icu_utf.h",
511     "third_party/nspr/prtime.cc",
512     "third_party/nspr/prtime.h",
513     "third_party/superfasthash/superfasthash.c",
514     "thread_task_runner_handle.cc",
515     "thread_task_runner_handle.h",
516     "threading/non_thread_safe.h",
517     "threading/non_thread_safe_impl.cc",
518     "threading/non_thread_safe_impl.h",
519     "threading/platform_thread.h",
520     "threading/platform_thread_android.cc",
521     "threading/platform_thread_internal_posix.cc",
522     "threading/platform_thread_internal_posix.h",
523     "threading/platform_thread_linux.cc",
524     "threading/platform_thread_mac.mm",
525     "threading/platform_thread_posix.cc",
526     "threading/platform_thread_win.cc",
527     "threading/post_task_and_reply_impl.cc",
528     "threading/post_task_and_reply_impl.h",
529     "threading/sequenced_worker_pool.cc",
530     "threading/sequenced_worker_pool.h",
531     "threading/simple_thread.cc",
532     "threading/simple_thread.h",
533     "threading/thread.cc",
534     "threading/thread.h",
535     "threading/thread_checker.h",
536     "threading/thread_checker_impl.cc",
537     "threading/thread_checker_impl.h",
538     "threading/thread_collision_warner.cc",
539     "threading/thread_collision_warner.h",
540     "threading/thread_id_name_manager.cc",
541     "threading/thread_id_name_manager.h",
542     "threading/thread_local.h",
543     "threading/thread_local_android.cc",
544     "threading/thread_local_posix.cc",
545     "threading/thread_local_storage.cc",
546     "threading/thread_local_storage.h",
547     "threading/thread_local_storage_posix.cc",
548     "threading/thread_local_storage_win.cc",
549     "threading/thread_local_win.cc",
550     "threading/thread_restrictions.cc",
551     "threading/thread_restrictions.h",
552     "threading/watchdog.cc",
553     "threading/watchdog.h",
554     "threading/worker_pool.cc",
555     "threading/worker_pool.h",
556     "threading/worker_pool_posix.cc",
557     "threading/worker_pool_posix.h",
558     "threading/worker_pool_win.cc",
559     "time/clock.cc",
560     "time/clock.h",
561     "time/default_clock.cc",
562     "time/default_clock.h",
563     "time/default_tick_clock.cc",
564     "time/default_tick_clock.h",
565     "time/tick_clock.cc",
566     "time/tick_clock.h",
567     "time/time.cc",
568     "time/time.h",
569     "time/time_mac.cc",
570     "time/time_posix.cc",
571     "time/time_win.cc",
572     "timer/elapsed_timer.cc",
573     "timer/elapsed_timer.h",
574     "timer/hi_res_timer_manager.h",
575     "timer/hi_res_timer_manager_posix.cc",
576     "timer/hi_res_timer_manager_win.cc",
577     "timer/mock_timer.cc",
578     "timer/mock_timer.h",
579     "timer/timer.cc",
580     "timer/timer.h",
581     "tracked_objects.cc",
582     "tracked_objects.h",
583     "tracking_info.cc",
584     "tracking_info.h",
585     "tuple.h",
586     "value_conversions.cc",
587     "value_conversions.h",
588     "values.cc",
589     "values.h",
590     "version.cc",
591     "version.h",
592     "vlog.cc",
593     "vlog.h",
594     "win/enum_variant.cc",
595     "win/enum_variant.h",
596     "win/event_trace_consumer.h",
597     "win/event_trace_controller.cc",
598     "win/event_trace_controller.h",
599     "win/event_trace_provider.cc",
600     "win/event_trace_provider.h",
601     "win/i18n.cc",
602     "win/i18n.h",
603     "win/iat_patch_function.cc",
604     "win/iat_patch_function.h",
605     "win/iunknown_impl.cc",
606     "win/iunknown_impl.h",
607     "win/message_window.cc",
608     "win/message_window.h",
609     "win/metro.cc",
610     "win/metro.h",
611     "win/object_watcher.cc",
612     "win/object_watcher.h",
613     "win/registry.cc",
614     "win/registry.h",
615     "win/resource_util.cc",
616     "win/resource_util.h",
617     "win/scoped_bstr.cc",
618     "win/scoped_bstr.h",
619     "win/scoped_co_mem.h",
620     "win/scoped_com_initializer.h",
621     "win/scoped_comptr.h",
622     "win/scoped_gdi_object.h",
623     "win/scoped_handle.cc",
624     "win/scoped_handle.h",
625     "win/scoped_hdc.h",
626     "win/scoped_hglobal.h",
627     "win/scoped_process_information.cc",
628     "win/scoped_process_information.h",
629     "win/scoped_propvariant.h",
630     "win/scoped_select_object.h",
631     "win/scoped_variant.cc",
632     "win/scoped_variant.h",
633     "win/shortcut.cc",
634     "win/shortcut.h",
635     "win/startup_information.cc",
636     "win/startup_information.h",
637     "win/win_util.cc",
638     "win/win_util.h",
639     "win/windows_version.cc",
640     "win/windows_version.h",
641     "win/wrapped_window_proc.cc",
642     "win/wrapped_window_proc.h",
643   ]
645   if (is_ios) {
646     sources -= [
647       "message_loop/message_pump_libevent.cc",
648       "message_loop/message_pump_libevent.h",
649     ]
651     set_sources_assignment_filter([])
652     sources += [ "files/file_path_watcher_mac.cc" ]
653     set_sources_assignment_filter(sources_assignment_filter)
654   }
656   sources -= [
657     "sys_info_freebsd.cc",
658     "sys_info_openbsd.cc",
659   ]
661   data = []
663   configs += [
664     ":base_implementation",
665     "//build/config:precompiled_headers",
666   ]
668   deps = [
669     ":base_static",
670     "//base/allocator:allocator_extension_thunks",
671     "//base/third_party/dynamic_annotations",
672     "//third_party/modp_b64",
673   ]
675   public_deps = [
676     ":base_paths",
677     "//base/debug",
678     "//base/json",
679     "//base/memory",
680     "//base/metrics",
681     "//base/process",
682     "//base/trace_event",
683   ]
685   # Allow more direct string conversions on platforms with native utf8
686   # strings
687   if (is_mac || is_ios || is_chromeos) {
688     defines = [ "SYSTEM_NATIVE_UTF8" ]
689   }
691   if (is_android) {
692     sources -= [ "power_monitor/power_monitor_device_source_posix.cc" ]
694     # Android uses some Linux sources, put those back.
695     set_sources_assignment_filter([])
696     sources += [
697       "files/file_path_watcher_linux.cc",
698       "posix/unix_domain_socket_linux.cc",
699       "sys_info_linux.cc",
700     ]
701     set_sources_assignment_filter(sources_assignment_filter)
703     deps += [
704       ":base_jni_headers",
705       "//third_party/ashmem",
706       "//third_party/android_tools:cpu_features",
707     ]
709     # logging.cc uses the Android logging library.
710     libs = [ "log" ]
711   }
713   if (is_chromeos) {
714     sources -= [ "power_monitor/power_monitor_device_source_posix.cc" ]
715   }
717   if (is_nacl) {
718     # We reset sources_assignment_filter in order to explicitly include
719     # the linux file (which would otherwise be filtered out).
720     set_sources_assignment_filter([])
721     sources += [
722       "files/file_path_watcher_stub.cc",
723       "sync_socket_nacl.cc",
724       "threading/platform_thread_linux.cc",
725     ]
726     set_sources_assignment_filter(sources_assignment_filter)
728     sources -= [
729       "allocator/type_profiler_control.cc",
730       "allocator/type_profiler_control.h",
731       "async_socket_io_handler_posix.cc",
732       "cpu.cc",
733       "files/file_enumerator_posix.cc",
734       "files/file_proxy.cc",
735       "files/file_util.cc",
736       "files/file_util_posix.cc",
737       "files/file_util_proxy.cc",
738       "files/important_file_writer.cc",
739       "files/important_file_writer.h",
740       "files/scoped_temp_dir.cc",
741       "message_loop/message_pump_libevent.cc",
742       "native_library_posix.cc",
743       "path_service.cc",
744       "rand_util_posix.cc",
745       "scoped_native_library.cc",
746       "sync_socket_posix.cc",
747       "sys_info.cc",
748       "sys_info_posix.cc",
749     ]
750   } else {
751     # Remove NaCl stuff.
752     sources -= [
753       "os_compat_nacl.cc",
754       "os_compat_nacl.h",
755       "rand_util_nacl.cc",
756     ]
757   }
759   # Windows.
760   if (is_win) {
761     sources += [
762       "profiler/win32_stack_frame_unwinder.cc",
763       "profiler/win32_stack_frame_unwinder.h",
764     ]
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/memory_mapped_file_unittest.cc",
1260     "files/scoped_temp_dir_unittest.cc",
1261     "gmock_unittest.cc",
1262     "guid_unittest.cc",
1263     "hash_unittest.cc",
1264     "i18n/break_iterator_unittest.cc",
1265     "i18n/case_conversion_unittest.cc",
1266     "i18n/char_iterator_unittest.cc",
1267     "i18n/file_util_icu_unittest.cc",
1268     "i18n/icu_string_conversions_unittest.cc",
1269     "i18n/message_formatter_unittest.cc",
1270     "i18n/number_formatting_unittest.cc",
1271     "i18n/rtl_unittest.cc",
1272     "i18n/streaming_utf8_validator_unittest.cc",
1273     "i18n/string_search_unittest.cc",
1274     "i18n/time_formatting_unittest.cc",
1275     "i18n/timezone_unittest.cc",
1276     "id_map_unittest.cc",
1277     "ios/device_util_unittest.mm",
1278     "ios/weak_nsobject_unittest.mm",
1279     "json/json_parser_unittest.cc",
1280     "json/json_reader_unittest.cc",
1281     "json/json_value_converter_unittest.cc",
1282     "json/json_value_serializer_unittest.cc",
1283     "json/json_writer_unittest.cc",
1284     "json/string_escape_unittest.cc",
1285     "lazy_instance_unittest.cc",
1286     "logging_unittest.cc",
1287     "mac/bind_objc_block_unittest.mm",
1288     "mac/call_with_eh_frame_unittest.mm",
1289     "mac/dispatch_source_mach_unittest.cc",
1290     "mac/foundation_util_unittest.mm",
1291     "mac/libdispatch_task_runner_unittest.cc",
1292     "mac/mac_util_unittest.mm",
1293     "mac/objc_property_releaser_unittest.mm",
1294     "mac/scoped_nsobject_unittest.mm",
1295     "mac/scoped_objc_class_swizzler_unittest.mm",
1296     "mac/scoped_sending_event_unittest.mm",
1297     "md5_unittest.cc",
1298     "memory/aligned_memory_unittest.cc",
1299     "memory/discardable_shared_memory_unittest.cc",
1300     "memory/linked_ptr_unittest.cc",
1301     "memory/memory_pressure_monitor_chromeos_unittest.cc",
1302     "memory/memory_pressure_monitor_win_unittest.cc",
1303     "memory/ref_counted_memory_unittest.cc",
1304     "memory/ref_counted_unittest.cc",
1305     "memory/scoped_ptr_unittest.cc",
1306     "memory/scoped_ptr_unittest.nc",
1307     "memory/scoped_vector_unittest.cc",
1308     "memory/shared_memory_unittest.cc",
1309     "memory/singleton_unittest.cc",
1310     "memory/weak_ptr_unittest.cc",
1311     "memory/weak_ptr_unittest.nc",
1312     "message_loop/message_loop_task_runner_unittest.cc",
1313     "message_loop/message_loop_unittest.cc",
1314     "message_loop/message_pump_glib_unittest.cc",
1315     "message_loop/message_pump_io_ios_unittest.cc",
1316     "metrics/bucket_ranges_unittest.cc",
1317     "metrics/field_trial_unittest.cc",
1318     "metrics/histogram_base_unittest.cc",
1319     "metrics/histogram_delta_serialization_unittest.cc",
1320     "metrics/histogram_macros_unittest.cc",
1321     "metrics/histogram_snapshot_manager_unittest.cc",
1322     "metrics/histogram_unittest.cc",
1323     "metrics/sample_map_unittest.cc",
1324     "metrics/sample_vector_unittest.cc",
1325     "metrics/sparse_histogram_unittest.cc",
1326     "metrics/statistics_recorder_unittest.cc",
1327     "move_unittest.cc",
1328     "numerics/safe_numerics_unittest.cc",
1329     "observer_list_unittest.cc",
1330     "os_compat_android_unittest.cc",
1331     "path_service_unittest.cc",
1332     "pickle_unittest.cc",
1333     "posix/file_descriptor_shuffle_unittest.cc",
1334     "posix/unix_domain_socket_linux_unittest.cc",
1335     "power_monitor/power_monitor_unittest.cc",
1336     "prefs/default_pref_store_unittest.cc",
1337     "prefs/json_pref_store_unittest.cc",
1338     "prefs/overlay_user_pref_store_unittest.cc",
1339     "prefs/pref_change_registrar_unittest.cc",
1340     "prefs/pref_member_unittest.cc",
1341     "prefs/pref_notifier_impl_unittest.cc",
1342     "prefs/pref_service_unittest.cc",
1343     "prefs/pref_value_map_unittest.cc",
1344     "prefs/pref_value_store_unittest.cc",
1345     "prefs/scoped_user_pref_update_unittest.cc",
1346     "process/memory_unittest.cc",
1347     "process/memory_unittest_mac.h",
1348     "process/memory_unittest_mac.mm",
1349     "process/process_metrics_unittest.cc",
1350     "process/process_metrics_unittest_ios.cc",
1351     "process/process_unittest.cc",
1352     "process/process_util_unittest.cc",
1353     "profiler/stack_sampling_profiler_unittest.cc",
1354     "profiler/tracked_time_unittest.cc",
1355     "rand_util_unittest.cc",
1356     "scoped_clear_errno_unittest.cc",
1357     "scoped_generic_unittest.cc",
1358     "scoped_native_library_unittest.cc",
1359     "security_unittest.cc",
1360     "sequence_checker_unittest.cc",
1361     "sha1_unittest.cc",
1362     "stl_util_unittest.cc",
1363     "strings/nullable_string16_unittest.cc",
1364     "strings/pattern_unittest.cc",
1365     "strings/safe_sprintf_unittest.cc",
1366     "strings/string16_unittest.cc",
1367     "strings/string_number_conversions_unittest.cc",
1368     "strings/string_piece_unittest.cc",
1369     "strings/string_split_unittest.cc",
1370     "strings/string_tokenizer_unittest.cc",
1371     "strings/string_util_unittest.cc",
1372     "strings/stringize_macros_unittest.cc",
1373     "strings/stringprintf_unittest.cc",
1374     "strings/sys_string_conversions_mac_unittest.mm",
1375     "strings/sys_string_conversions_unittest.cc",
1376     "strings/utf_offset_string_conversions_unittest.cc",
1377     "strings/utf_string_conversions_unittest.cc",
1378     "supports_user_data_unittest.cc",
1379     "sync_socket_unittest.cc",
1380     "synchronization/cancellation_flag_unittest.cc",
1381     "synchronization/condition_variable_unittest.cc",
1382     "synchronization/lock_unittest.cc",
1383     "synchronization/waitable_event_unittest.cc",
1384     "synchronization/waitable_event_watcher_unittest.cc",
1385     "sys_info_unittest.cc",
1386     "system_monitor/system_monitor_unittest.cc",
1387     "task/cancelable_task_tracker_unittest.cc",
1388     "task_runner_util_unittest.cc",
1389     "template_util_unittest.cc",
1390     "test/histogram_tester_unittest.cc",
1391     "test/icu_test_util.cc",
1392     "test/icu_test_util.h",
1393     "test/test_pending_task_unittest.cc",
1394     "test/test_reg_util_win_unittest.cc",
1395     "test/trace_event_analyzer_unittest.cc",
1396     "test/user_action_tester_unittest.cc",
1397     "threading/non_thread_safe_unittest.cc",
1398     "threading/platform_thread_unittest.cc",
1399     "threading/sequenced_worker_pool_unittest.cc",
1400     "threading/simple_thread_unittest.cc",
1401     "threading/thread_checker_unittest.cc",
1402     "threading/thread_collision_warner_unittest.cc",
1403     "threading/thread_id_name_manager_unittest.cc",
1404     "threading/thread_local_storage_unittest.cc",
1405     "threading/thread_local_unittest.cc",
1406     "threading/thread_unittest.cc",
1407     "threading/watchdog_unittest.cc",
1408     "threading/worker_pool_posix_unittest.cc",
1409     "threading/worker_pool_unittest.cc",
1410     "time/pr_time_unittest.cc",
1411     "time/time_unittest.cc",
1412     "time/time_win_unittest.cc",
1413     "timer/hi_res_timer_manager_unittest.cc",
1414     "timer/mock_timer_unittest.cc",
1415     "timer/timer_unittest.cc",
1416     "tools_sanity_unittest.cc",
1417     "tracked_objects_unittest.cc",
1418     "tuple_unittest.cc",
1419     "values_unittest.cc",
1420     "version_unittest.cc",
1421     "vlog_unittest.cc",
1422     "win/dllmain.cc",
1423     "win/enum_variant_unittest.cc",
1424     "win/event_trace_consumer_unittest.cc",
1425     "win/event_trace_controller_unittest.cc",
1426     "win/event_trace_provider_unittest.cc",
1427     "win/i18n_unittest.cc",
1428     "win/iunknown_impl_unittest.cc",
1429     "win/message_window_unittest.cc",
1430     "win/object_watcher_unittest.cc",
1431     "win/pe_image_unittest.cc",
1432     "win/registry_unittest.cc",
1433     "win/scoped_bstr_unittest.cc",
1434     "win/scoped_comptr_unittest.cc",
1435     "win/scoped_process_information_unittest.cc",
1436     "win/scoped_variant_unittest.cc",
1437     "win/shortcut_unittest.cc",
1438     "win/startup_information_unittest.cc",
1439     "win/win_util_unittest.cc",
1440     "win/wrapped_window_proc_unittest.cc",
1441   ]
1443   deps = [
1444     ":base",
1445     ":i18n",
1446     ":message_loop_tests",
1447     ":prefs",
1448     ":prefs_test_support",
1449     "//base/allocator",
1450     "//base/test:run_all_unittests",
1451     "//base/test:test_support",
1452     "//base/third_party/dynamic_annotations",
1453     "//base/trace_event:trace_event_unittests",
1454     "//testing/gmock",
1455     "//testing/gtest",
1456     "//third_party/icu",
1457   ]
1459   data = [
1460     "test/data/",
1461   ]
1463   # Allow more direct string conversions on platforms with native utf8
1464   # strings
1465   if (is_mac || is_ios || is_chromeos) {
1466     defines = [ "SYSTEM_NATIVE_UTF8" ]
1467   }
1469   if (is_android) {
1470     apk_deps = [
1471       ":base_java",
1472       ":base_java_unittest_support",
1473     ]
1475     # TODO(brettw) I think this should not be here, we should not be using
1476     # isolate files.
1477     isolate_file = "base_unittests.isolate"
1478   }
1480   if (is_ios) {
1481     sources -= [
1482       "memory/discardable_shared_memory_unittest.cc",
1483       "memory/shared_memory_unittest.cc",
1484       "process/memory_unittest.cc",
1485       "process/process_unittest.cc",
1486       "process/process_util_unittest.cc",
1487     ]
1489     # Pull in specific Mac files for iOS (which have been filtered out by file
1490     # name rules).
1491     set_sources_assignment_filter([])
1492     sources += [
1493       "mac/bind_objc_block_unittest.mm",
1494       "mac/foundation_util_unittest.mm",
1495       "mac/objc_property_releaser_unittest.mm",
1496       "mac/scoped_nsobject_unittest.mm",
1497       "strings/sys_string_conversions_mac_unittest.mm",
1498     ]
1499     set_sources_assignment_filter(sources_assignment_filter)
1501     # TODO(GYP): dep on copy_test_data_ios action.
1502   }
1504   if (is_linux) {
1505     sources -= [ "file_version_info_unittest.cc" ]
1506     sources += [ "nix/xdg_util_unittest.cc" ]
1507     deps += [ "//base/test:malloc_wrapper" ]
1509     if (use_glib) {
1510       configs += [ "//build/config/linux:glib" ]
1511     }
1512   }
1514   if (!is_linux || use_ozone) {
1515     sources -= [ "message_loop/message_pump_glib_unittest.cc" ]
1516   }
1518   if (is_posix && !is_ios) {
1519     sources += [ "message_loop/message_pump_libevent_unittest.cc" ]
1520     deps += [ "//third_party/libevent" ]
1521   }
1523   if (is_android) {
1524     deps += [ "//testing/android/native_test:native_test_native_code" ]
1525     set_sources_assignment_filter([])
1526     sources += [ "debug/proc_maps_linux_unittest.cc" ]
1527     set_sources_assignment_filter(sources_assignment_filter)
1528   }
1530   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1531   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1533   # Symbols for crashes when running tests on swarming.
1534   if (symbol_level > 0) {
1535     if (is_win) {
1536       data += [ "$root_out_dir/base_unittests.exe.pdb" ]
1537     } else if (is_mac) {
1538       data += [ "$root_out_dir/base_unittests.dSYM/" ]
1539     }
1540   }
1543 if (is_android) {
1544   # GYP: //base.gyp:base_jni_headers
1545   generate_jni("base_jni_headers") {
1546     sources = [
1547       "android/java/src/org/chromium/base/AnimationFrameTimeHistogram.java",
1548       "android/java/src/org/chromium/base/ApkAssets.java",
1549       "android/java/src/org/chromium/base/ApplicationStatus.java",
1550       "android/java/src/org/chromium/base/BuildInfo.java",
1551       "android/java/src/org/chromium/base/CommandLine.java",
1552       "android/java/src/org/chromium/base/ContentUriUtils.java",
1553       "android/java/src/org/chromium/base/CpuFeatures.java",
1554       "android/java/src/org/chromium/base/EventLog.java",
1555       "android/java/src/org/chromium/base/FieldTrialList.java",
1556       "android/java/src/org/chromium/base/ImportantFileWriterAndroid.java",
1557       "android/java/src/org/chromium/base/JNIUtils.java",
1558       "android/java/src/org/chromium/base/JavaHandlerThread.java",
1559       "android/java/src/org/chromium/base/LocaleUtils.java",
1560       "android/java/src/org/chromium/base/MemoryPressureListener.java",
1561       "android/java/src/org/chromium/base/PathService.java",
1562       "android/java/src/org/chromium/base/PathUtils.java",
1563       "android/java/src/org/chromium/base/PowerMonitor.java",
1564       "android/java/src/org/chromium/base/SysUtils.java",
1565       "android/java/src/org/chromium/base/SystemMessageHandler.java",
1566       "android/java/src/org/chromium/base/ThreadUtils.java",
1567       "android/java/src/org/chromium/base/TraceEvent.java",
1568       "android/java/src/org/chromium/base/library_loader/LibraryLoader.java",
1569       "android/java/src/org/chromium/base/metrics/RecordHistogram.java",
1570       "android/java/src/org/chromium/base/metrics/RecordUserAction.java",
1571     ]
1573     deps = [
1574       ":android_runtime_jni_headers",
1575     ]
1577     jni_package = "base"
1578   }
1580   # GYP: //base.gyp:android_runtime_jni_headers
1581   generate_jar_jni("android_runtime_jni_headers") {
1582     jni_package = "base"
1583     classes = [ "java/lang/Runtime.class" ]
1584   }
1586   # GYP: //base.gyp:base_java
1587   android_library("base_java") {
1588     srcjar_deps = [
1589       ":base_android_java_enums_srcjar",
1590       ":base_native_libraries_gen",
1591     ]
1593     deps = [
1594       "//third_party/jsr-305:jsr_305_javalib",
1595     ]
1597     DEPRECATED_java_in_dir = "android/java/src"
1599     # A new version of NativeLibraries.java (with the actual correct values)
1600     # will be created when creating an apk.
1601     jar_excluded_patterns = [
1602       "*/NativeLibraries.class",
1603       "*/NativeLibraries##*.class",
1604     ]
1605   }
1607   # GYP: //base.gyp:base_javatests
1608   android_library("base_javatests") {
1609     deps = [
1610       ":base_java",
1611       ":base_java_test_support",
1612     ]
1613     DEPRECATED_java_in_dir = "android/javatests/src"
1614   }
1616   # GYP: //base.gyp:base_java_test_support
1617   android_library("base_java_test_support") {
1618     deps = [
1619       ":base_java",
1620       "//testing/android/reporter:reporter_java",
1621     ]
1622     DEPRECATED_java_in_dir = "test/android/javatests/src"
1623   }
1625   # GYP: //base.gyp:base_junit_tests
1626   junit_binary("base_junit_tests") {
1627     java_files = [ "android/junit/src/org/chromium/base/LogTest.java" ]
1628     deps = [
1629       ":base_java",
1630       ":base_java_test_support",
1631     ]
1632   }
1634   # GYP: //base.gyp:base_java_application_state
1635   # GYP: //base.gyp:base_java_library_load_from_apk_status_codes
1636   # GYP: //base.gyp:base_java_library_process_type
1637   # GYP: //base.gyp:base_java_memory_pressure_level
1638   java_cpp_enum("base_android_java_enums_srcjar") {
1639     sources = [
1640       "android/application_status_listener.h",
1641       "android/library_loader/library_load_from_apk_status_codes.h",
1642       "android/library_loader/library_loader_hooks.h",
1643       "memory/memory_pressure_listener.h",
1644     ]
1645     outputs = [
1646       "org/chromium/base/ApplicationState.java",
1647       "org/chromium/base/library_loader/LibraryLoadFromApkStatusCodes.java",
1648       "org/chromium/base/library_loader/LibraryProcessType.java",
1649       "org/chromium/base/MemoryPressureLevel.java",
1650     ]
1651   }
1653   # GYP: //base/base.gyp:base_native_libraries_gen
1654   java_cpp_template("base_native_libraries_gen") {
1655     sources = [
1656       "android/java/templates/NativeLibraries.template",
1657     ]
1658     package_name = "org/chromium/base/library_loader"
1659   }
1661   # GYP: //base.gyp:base_java_unittest_support
1662   android_library("base_java_unittest_support") {
1663     deps = [
1664       ":base_java",
1665     ]
1666     java_files =
1667         [ "test/android/java/src/org/chromium/base/ContentUriTestUtils.java" ]
1668   }