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