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