blob: fea9027e4b3962a49035fac1da33170773630203 [file] [log] [blame]
James Robinson646469d2014-10-03 15:33:28 -07001# 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.
4
5import("//build/config/ui.gni")
James Robinson5e66a792015-01-21 17:02:08 -08006import("//testing/test.gni")
James Robinson646469d2014-10-03 15:33:28 -07007
8if (is_android) {
9 import("//build/config/android/rules.gni")
10}
11
Dave Moore0ae79f42015-03-17 12:56:46 -070012config("base_implementation") {
13 defines = [ "BASE_IMPLEMENTATION" ]
14}
15
James Robinson0fae0002015-05-05 16:31:51 -070016if (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 }
26}
27
Nick Bray0bcbd3b2015-03-12 16:29:36 -070028source_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 ]
41
42 if (is_android || is_mac) {
43 sources -= [ "base_paths_posix.cc" ]
44 }
45
46 if (is_nacl) {
47 sources -= [
48 "base_paths.cc",
49 "base_paths_posix.cc",
50 ]
51 }
52
Dave Moore0ae79f42015-03-17 12:56:46 -070053 configs += [ ":base_implementation" ]
Nick Bray0bcbd3b2015-03-12 16:29:36 -070054
55 deps = [
56 "//base/memory",
57 "//base/process",
58 ]
59
60 visibility = [ ":base" ]
61}
62
James Robinson646469d2014-10-03 15:33:28 -070063component("base") {
64 sources = [
James Robinson646469d2014-10-03 15:33:28 -070065 "allocator/allocator_extension.cc",
66 "allocator/allocator_extension.h",
67 "allocator/type_profiler_control.cc",
68 "allocator/type_profiler_control.h",
Dave Moorecc0e4f92015-03-10 15:23:04 -070069 "android/animation_frame_time_histogram.cc",
70 "android/animation_frame_time_histogram.h",
Viet-Trung Luu235cf3d2015-06-11 10:01:25 -070071 "android/apk_assets.cc",
72 "android/apk_assets.h",
James Robinson646469d2014-10-03 15:33:28 -070073 "android/application_status_listener.cc",
74 "android/application_status_listener.h",
Benjamin Lermancdfc88d2015-02-03 14:35:12 +010075 "android/base_jni_onload.cc",
76 "android/base_jni_onload.h",
James Robinson646469d2014-10-03 15:33:28 -070077 "android/base_jni_registrar.cc",
78 "android/base_jni_registrar.h",
79 "android/build_info.cc",
80 "android/build_info.h",
81 "android/command_line_android.cc",
82 "android/command_line_android.h",
83 "android/content_uri_utils.cc",
84 "android/content_uri_utils.h",
85 "android/cpu_features.cc",
86 "android/event_log.cc",
87 "android/event_log.h",
88 "android/field_trial_list.cc",
89 "android/field_trial_list.h",
90 "android/fifo_utils.cc",
91 "android/fifo_utils.h",
92 "android/important_file_writer_android.cc",
93 "android/important_file_writer_android.h",
Benjamin Lermandf06e5f2015-01-22 13:22:57 +010094 "android/java_handler_thread.cc",
95 "android/java_handler_thread.h",
James Robinson0fae0002015-05-05 16:31:51 -070096 "android/java_runtime.cc",
97 "android/java_runtime.h",
James Robinson646469d2014-10-03 15:33:28 -070098 "android/jni_android.cc",
99 "android/jni_android.h",
100 "android/jni_array.cc",
101 "android/jni_array.h",
102 "android/jni_registrar.cc",
103 "android/jni_registrar.h",
104 "android/jni_string.cc",
105 "android/jni_string.h",
106 "android/jni_utils.cc",
107 "android/jni_utils.h",
108 "android/jni_weak_ref.cc",
109 "android/jni_weak_ref.h",
Benjamin Lermandf06e5f2015-01-22 13:22:57 +0100110 "android/library_loader/library_load_from_apk_status_codes.h",
James Robinson646469d2014-10-03 15:33:28 -0700111 "android/library_loader/library_loader_hooks.cc",
112 "android/library_loader/library_loader_hooks.h",
James Robinsonf19b1022015-05-05 18:12:15 -0700113 "android/library_loader/library_prefetcher.cc",
114 "android/library_loader/library_prefetcher.h",
Benjamin Lermandf06e5f2015-01-22 13:22:57 +0100115 "android/locale_utils.cc",
116 "android/locale_utils.h",
James Robinson646469d2014-10-03 15:33:28 -0700117 "android/memory_pressure_listener_android.cc",
118 "android/memory_pressure_listener_android.h",
James Robinson646469d2014-10-03 15:33:28 -0700119 "android/path_service_android.cc",
120 "android/path_service_android.h",
121 "android/path_utils.cc",
122 "android/path_utils.h",
Benjamin Lermandf06e5f2015-01-22 13:22:57 +0100123 "android/record_histogram.cc",
124 "android/record_histogram.h",
James Robinson0fae0002015-05-05 16:31:51 -0700125 "android/record_user_action.cc",
126 "android/record_user_action.h",
Benjamin Lermandf06e5f2015-01-22 13:22:57 +0100127 "android/scoped_java_ref.cc",
128 "android/scoped_java_ref.h",
James Robinson646469d2014-10-03 15:33:28 -0700129 "android/sys_utils.cc",
130 "android/sys_utils.h",
131 "android/thread_utils.h",
132 "android/trace_event_binding.cc",
133 "android/trace_event_binding.h",
134 "async_socket_io_handler.h",
135 "async_socket_io_handler_posix.cc",
136 "async_socket_io_handler_win.cc",
137 "at_exit.cc",
138 "at_exit.h",
139 "atomic_ref_count.h",
140 "atomic_sequence_num.h",
141 "atomicops.h",
142 "atomicops_internals_gcc.h",
143 "atomicops_internals_mac.h",
James Robinsone2ac7e82014-10-15 13:21:59 -0700144 "atomicops_internals_portable.h",
James Robinson646469d2014-10-03 15:33:28 -0700145 "atomicops_internals_x86_gcc.cc",
146 "atomicops_internals_x86_gcc.h",
147 "atomicops_internals_x86_msvc.h",
148 "auto_reset.h",
149 "barrier_closure.cc",
150 "barrier_closure.h",
Etienne Membrives386015a2015-02-19 17:27:12 +0100151 "base64.cc",
152 "base64.h",
James Robinson646469d2014-10-03 15:33:28 -0700153 "base_export.h",
James Robinson646469d2014-10-03 15:33:28 -0700154 "base_switches.h",
James Robinson646469d2014-10-03 15:33:28 -0700155 "basictypes.h",
156 "big_endian.cc",
157 "big_endian.h",
158 "bind.h",
159 "bind_helpers.cc",
160 "bind_helpers.h",
161 "bind_internal.h",
162 "bind_internal_win.h",
163 "bits.h",
164 "build_time.cc",
165 "build_time.h",
166 "callback.h",
167 "callback_helpers.cc",
168 "callback_helpers.h",
169 "callback_internal.cc",
170 "callback_internal.h",
171 "cancelable_callback.h",
Etienne Membrives386015a2015-02-19 17:27:12 +0100172 "command_line.cc",
173 "command_line.h",
James Robinson646469d2014-10-03 15:33:28 -0700174 "compiler_specific.h",
175 "containers/adapters.h",
176 "containers/hash_tables.h",
177 "containers/linked_list.h",
178 "containers/mru_cache.h",
James Robinsonf19b1022015-05-05 18:12:15 -0700179 "containers/scoped_ptr_hash_map.h",
James Robinson646469d2014-10-03 15:33:28 -0700180 "containers/small_map.h",
181 "containers/stack_container.h",
182 "cpu.cc",
183 "cpu.h",
184 "critical_closure.h",
185 "critical_closure_internal_ios.mm",
James Robinson646469d2014-10-03 15:33:28 -0700186 "deferred_sequenced_task_runner.cc",
187 "deferred_sequenced_task_runner.h",
188 "environment.cc",
189 "environment.h",
James Robinson646469d2014-10-03 15:33:28 -0700190 "file_descriptor_posix.h",
191 "file_version_info.h",
192 "file_version_info_mac.h",
193 "file_version_info_mac.mm",
194 "file_version_info_win.cc",
195 "file_version_info_win.h",
196 "files/dir_reader_fallback.h",
197 "files/dir_reader_linux.h",
198 "files/dir_reader_posix.h",
199 "files/file.cc",
James Robinson646469d2014-10-03 15:33:28 -0700200 "files/file_enumerator.cc",
201 "files/file_enumerator.h",
202 "files/file_enumerator_posix.cc",
203 "files/file_enumerator_win.cc",
204 "files/file_path.cc",
205 "files/file_path.h",
206 "files/file_path_constants.cc",
207 "files/file_path_watcher.cc",
208 "files/file_path_watcher.h",
209 "files/file_path_watcher_fsevents.cc",
210 "files/file_path_watcher_fsevents.h",
211 "files/file_path_watcher_kqueue.cc",
212 "files/file_path_watcher_kqueue.h",
213 "files/file_path_watcher_linux.cc",
214 "files/file_path_watcher_mac.cc",
215 "files/file_path_watcher_win.cc",
Etienne Membrives386015a2015-02-19 17:27:12 +0100216 "files/file_posix.cc",
James Robinson646469d2014-10-03 15:33:28 -0700217 "files/file_proxy.cc",
218 "files/file_proxy.h",
James Robinsonc8f302a2015-05-14 16:38:33 -0700219 "files/file_tracing.cc",
220 "files/file_tracing.h",
James Robinson646469d2014-10-03 15:33:28 -0700221 "files/file_util.cc",
222 "files/file_util.h",
223 "files/file_util_android.cc",
224 "files/file_util_linux.cc",
225 "files/file_util_mac.mm",
226 "files/file_util_posix.cc",
227 "files/file_util_proxy.cc",
228 "files/file_util_proxy.h",
229 "files/file_util_win.cc",
Etienne Membrives386015a2015-02-19 17:27:12 +0100230 "files/file_win.cc",
James Robinson646469d2014-10-03 15:33:28 -0700231 "files/important_file_writer.cc",
232 "files/important_file_writer.h",
233 "files/memory_mapped_file.cc",
234 "files/memory_mapped_file.h",
235 "files/memory_mapped_file_posix.cc",
236 "files/memory_mapped_file_win.cc",
237 "files/scoped_file.cc",
238 "files/scoped_file.h",
239 "files/scoped_temp_dir.cc",
240 "files/scoped_temp_dir.h",
James Robinson646469d2014-10-03 15:33:28 -0700241 "format_macros.h",
242 "gtest_prod_util.h",
243 "guid.cc",
244 "guid.h",
245 "guid_posix.cc",
246 "guid_win.cc",
247 "hash.cc",
248 "hash.h",
249 "id_map.h",
250 "ios/device_util.h",
251 "ios/device_util.mm",
252 "ios/ios_util.h",
253 "ios/ios_util.mm",
254 "ios/scoped_critical_action.h",
255 "ios/scoped_critical_action.mm",
Etienne Membrivesb1556b32014-12-16 13:56:09 +0100256 "ios/weak_nsobject.h",
257 "ios/weak_nsobject.mm",
James Robinson646469d2014-10-03 15:33:28 -0700258 "lazy_instance.cc",
259 "lazy_instance.h",
260 "linux_util.cc",
261 "linux_util.h",
262 "location.cc",
263 "location.h",
264 "logging.cc",
265 "logging.h",
266 "logging_win.cc",
267 "logging_win.h",
268 "mac/authorization_util.h",
269 "mac/authorization_util.mm",
270 "mac/bind_objc_block.h",
271 "mac/bundle_locations.h",
272 "mac/bundle_locations.mm",
273 "mac/cocoa_protocols.h",
James Robinsonc8f302a2015-05-14 16:38:33 -0700274 "mac/dispatch_source_mach.cc",
275 "mac/dispatch_source_mach.h",
James Robinson646469d2014-10-03 15:33:28 -0700276 "mac/foundation_util.h",
277 "mac/foundation_util.mm",
278 "mac/launch_services_util.cc",
279 "mac/launch_services_util.h",
280 "mac/launchd.cc",
281 "mac/launchd.h",
282 "mac/libdispatch_task_runner.cc",
283 "mac/libdispatch_task_runner.h",
James Robinson646469d2014-10-03 15:33:28 -0700284 "mac/mac_logging.cc",
Etienne Membrives386015a2015-02-19 17:27:12 +0100285 "mac/mac_logging.h",
James Robinson646469d2014-10-03 15:33:28 -0700286 "mac/mac_util.h",
287 "mac/mac_util.mm",
288 "mac/mach_logging.cc",
289 "mac/mach_logging.h",
290 "mac/objc_property_releaser.h",
291 "mac/objc_property_releaser.mm",
292 "mac/os_crash_dumps.cc",
293 "mac/os_crash_dumps.h",
294 "mac/scoped_aedesc.h",
295 "mac/scoped_authorizationref.h",
296 "mac/scoped_block.h",
297 "mac/scoped_cftyperef.h",
298 "mac/scoped_ioobject.h",
299 "mac/scoped_ioplugininterface.h",
300 "mac/scoped_launch_data.h",
301 "mac/scoped_mach_port.cc",
302 "mac/scoped_mach_port.h",
303 "mac/scoped_mach_vm.cc",
304 "mac/scoped_mach_vm.h",
305 "mac/scoped_nsautorelease_pool.h",
306 "mac/scoped_nsautorelease_pool.mm",
307 "mac/scoped_nsexception_enabler.h",
308 "mac/scoped_nsexception_enabler.mm",
309 "mac/scoped_nsobject.h",
310 "mac/scoped_objc_class_swizzler.h",
311 "mac/scoped_objc_class_swizzler.mm",
312 "mac/scoped_sending_event.h",
313 "mac/scoped_sending_event.mm",
314 "mac/sdk_forward_declarations.h",
Benjamin Lerman507bb1a2015-02-26 13:15:17 +0100315 "mac/sdk_forward_declarations.mm",
James Robinson646469d2014-10-03 15:33:28 -0700316 "macros.h",
317 "md5.cc",
318 "md5.h",
James Robinson646469d2014-10-03 15:33:28 -0700319 "message_loop/incoming_task_queue.cc",
320 "message_loop/incoming_task_queue.h",
321 "message_loop/message_loop.cc",
322 "message_loop/message_loop.h",
323 "message_loop/message_loop_proxy.cc",
324 "message_loop/message_loop_proxy.h",
325 "message_loop/message_loop_proxy_impl.cc",
326 "message_loop/message_loop_proxy_impl.h",
327 "message_loop/message_pump.cc",
328 "message_loop/message_pump.h",
329 "message_loop/message_pump_android.cc",
330 "message_loop/message_pump_android.h",
331 "message_loop/message_pump_default.cc",
332 "message_loop/message_pump_default.h",
333 "message_loop/message_pump_glib.cc",
334 "message_loop/message_pump_glib.h",
335 "message_loop/message_pump_io_ios.cc",
336 "message_loop/message_pump_io_ios.h",
337 "message_loop/message_pump_libevent.cc",
338 "message_loop/message_pump_libevent.h",
339 "message_loop/message_pump_mac.h",
340 "message_loop/message_pump_mac.mm",
341 "message_loop/message_pump_win.cc",
342 "message_loop/message_pump_win.h",
James Robinson646469d2014-10-03 15:33:28 -0700343 "move.h",
344 "native_library.h",
James Robinson0fae0002015-05-05 16:31:51 -0700345 "native_library_ios.mm",
James Robinson646469d2014-10-03 15:33:28 -0700346 "native_library_mac.mm",
347 "native_library_posix.cc",
348 "native_library_win.cc",
James Robinson646469d2014-10-03 15:33:28 -0700349 "nix/mime_util_xdg.cc",
350 "nix/mime_util_xdg.h",
351 "nix/xdg_util.cc",
352 "nix/xdg_util.h",
Etienne Membrives386015a2015-02-19 17:27:12 +0100353 "numerics/safe_conversions.h",
354 "numerics/safe_conversions_impl.h",
355 "numerics/safe_math.h",
356 "numerics/safe_math_impl.h",
James Robinson646469d2014-10-03 15:33:28 -0700357 "observer_list.h",
358 "observer_list_threadsafe.h",
359 "os_compat_android.cc",
360 "os_compat_android.h",
361 "os_compat_nacl.cc",
362 "os_compat_nacl.h",
363 "path_service.cc",
364 "path_service.h",
365 "pending_task.cc",
366 "pending_task.h",
367 "pickle.cc",
368 "pickle.h",
369 "port.h",
370 "posix/eintr_wrapper.h",
371 "posix/file_descriptor_shuffle.cc",
372 "posix/global_descriptors.cc",
373 "posix/global_descriptors.h",
Viet-Trung Luu235cf3d2015-06-11 10:01:25 -0700374 "posix/safe_strerror.cc",
375 "posix/safe_strerror.h",
James Robinson646469d2014-10-03 15:33:28 -0700376 "posix/unix_domain_socket_linux.cc",
377 "posix/unix_domain_socket_linux.h",
378 "power_monitor/power_monitor.cc",
379 "power_monitor/power_monitor.h",
380 "power_monitor/power_monitor_device_source.cc",
381 "power_monitor/power_monitor_device_source.h",
382 "power_monitor/power_monitor_device_source_android.cc",
383 "power_monitor/power_monitor_device_source_android.h",
James Robinsonbaf71d32014-10-08 13:00:20 -0700384 "power_monitor/power_monitor_device_source_chromeos.cc",
James Robinson646469d2014-10-03 15:33:28 -0700385 "power_monitor/power_monitor_device_source_ios.mm",
386 "power_monitor/power_monitor_device_source_mac.mm",
387 "power_monitor/power_monitor_device_source_posix.cc",
388 "power_monitor/power_monitor_device_source_win.cc",
389 "power_monitor/power_monitor_source.cc",
390 "power_monitor/power_monitor_source.h",
391 "power_monitor/power_observer.h",
James Robinson646469d2014-10-03 15:33:28 -0700392 "profiler/alternate_timer.cc",
393 "profiler/alternate_timer.h",
James Robinson0fae0002015-05-05 16:31:51 -0700394 "profiler/native_stack_sampler.cc",
395 "profiler/native_stack_sampler.h",
James Robinson53b77582014-10-28 17:00:48 -0700396 "profiler/scoped_profile.cc",
397 "profiler/scoped_profile.h",
398 "profiler/scoped_tracker.cc",
399 "profiler/scoped_tracker.h",
Alhaad Gokhale4f513072015-03-24 10:49:34 -0700400 "profiler/stack_sampling_profiler.cc",
401 "profiler/stack_sampling_profiler.h",
402 "profiler/stack_sampling_profiler_posix.cc",
403 "profiler/stack_sampling_profiler_win.cc",
James Robinson646469d2014-10-03 15:33:28 -0700404 "profiler/tracked_time.cc",
405 "profiler/tracked_time.h",
406 "rand_util.cc",
407 "rand_util.h",
408 "rand_util_nacl.cc",
409 "rand_util_posix.cc",
410 "rand_util_win.cc",
411 "run_loop.cc",
412 "run_loop.h",
James Robinson646469d2014-10-03 15:33:28 -0700413 "scoped_generic.h",
414 "scoped_native_library.cc",
415 "scoped_native_library.h",
416 "scoped_observer.h",
417 "sequence_checker.h",
418 "sequence_checker_impl.cc",
419 "sequence_checker_impl.h",
420 "sequenced_task_runner.cc",
421 "sequenced_task_runner.h",
422 "sequenced_task_runner_helpers.h",
423 "sha1.h",
424 "sha1_portable.cc",
425 "sha1_win.cc",
426 "single_thread_task_runner.h",
427 "stl_util.h",
428 "strings/latin1_string_conversions.cc",
429 "strings/latin1_string_conversions.h",
430 "strings/nullable_string16.cc",
431 "strings/nullable_string16.h",
432 "strings/safe_sprintf.cc",
433 "strings/safe_sprintf.h",
434 "strings/string16.cc",
435 "strings/string16.h",
436 "strings/string_number_conversions.cc",
James Robinson646469d2014-10-03 15:33:28 -0700437 "strings/string_number_conversions.h",
438 "strings/string_piece.cc",
439 "strings/string_piece.h",
Etienne Membrives386015a2015-02-19 17:27:12 +0100440 "strings/string_split.cc",
441 "strings/string_split.h",
James Robinson646469d2014-10-03 15:33:28 -0700442 "strings/string_tokenizer.h",
443 "strings/string_util.cc",
444 "strings/string_util.h",
445 "strings/string_util_constants.cc",
446 "strings/string_util_posix.h",
447 "strings/string_util_win.h",
448 "strings/stringize_macros.h",
449 "strings/stringprintf.cc",
450 "strings/stringprintf.h",
451 "strings/sys_string_conversions.h",
452 "strings/sys_string_conversions_mac.mm",
453 "strings/sys_string_conversions_posix.cc",
454 "strings/sys_string_conversions_win.cc",
455 "strings/utf_offset_string_conversions.cc",
456 "strings/utf_offset_string_conversions.h",
457 "strings/utf_string_conversion_utils.cc",
458 "strings/utf_string_conversion_utils.h",
459 "strings/utf_string_conversions.cc",
460 "strings/utf_string_conversions.h",
461 "supports_user_data.cc",
462 "supports_user_data.h",
463 "sync_socket.h",
464 "sync_socket_posix.cc",
465 "sync_socket_win.cc",
466 "synchronization/cancellation_flag.cc",
467 "synchronization/cancellation_flag.h",
468 "synchronization/condition_variable.h",
469 "synchronization/condition_variable_posix.cc",
470 "synchronization/condition_variable_win.cc",
471 "synchronization/lock.cc",
472 "synchronization/lock.h",
473 "synchronization/lock_impl.h",
474 "synchronization/lock_impl_posix.cc",
475 "synchronization/lock_impl_win.cc",
476 "synchronization/spin_wait.h",
477 "synchronization/waitable_event.h",
478 "synchronization/waitable_event_posix.cc",
479 "synchronization/waitable_event_watcher.h",
480 "synchronization/waitable_event_watcher_posix.cc",
481 "synchronization/waitable_event_watcher_win.cc",
482 "synchronization/waitable_event_win.cc",
James Robinson646469d2014-10-03 15:33:28 -0700483 "sys_byteorder.h",
484 "sys_info.cc",
485 "sys_info.h",
486 "sys_info_android.cc",
487 "sys_info_chromeos.cc",
488 "sys_info_freebsd.cc",
489 "sys_info_ios.mm",
490 "sys_info_linux.cc",
491 "sys_info_mac.cc",
492 "sys_info_openbsd.cc",
493 "sys_info_posix.cc",
494 "sys_info_win.cc",
Etienne Membrives386015a2015-02-19 17:27:12 +0100495 "system_monitor/system_monitor.cc",
496 "system_monitor/system_monitor.h",
James Robinson646469d2014-10-03 15:33:28 -0700497 "task/cancelable_task_tracker.cc",
498 "task/cancelable_task_tracker.h",
499 "task_runner.cc",
500 "task_runner.h",
501 "task_runner_util.h",
502 "template_util.h",
Nick Bray0bcbd3b2015-03-12 16:29:36 -0700503 "third_party/dmg_fp/dmg_fp.h",
504 "third_party/dmg_fp/dtoa_wrapper.cc",
505 "third_party/dmg_fp/g_fmt.cc",
506 "third_party/icu/icu_utf.cc",
507 "third_party/icu/icu_utf.h",
James Robinson0fae0002015-05-05 16:31:51 -0700508 "third_party/nspr/prtime.cc",
509 "third_party/nspr/prtime.h",
Nick Bray0bcbd3b2015-03-12 16:29:36 -0700510 "third_party/superfasthash/superfasthash.c",
James Robinson646469d2014-10-03 15:33:28 -0700511 "thread_task_runner_handle.cc",
512 "thread_task_runner_handle.h",
513 "threading/non_thread_safe.h",
514 "threading/non_thread_safe_impl.cc",
515 "threading/non_thread_safe_impl.h",
516 "threading/platform_thread.h",
517 "threading/platform_thread_android.cc",
Alhaad Gokhale4f513072015-03-24 10:49:34 -0700518 "threading/platform_thread_internal_posix.cc",
519 "threading/platform_thread_internal_posix.h",
James Robinson646469d2014-10-03 15:33:28 -0700520 "threading/platform_thread_linux.cc",
521 "threading/platform_thread_mac.mm",
522 "threading/platform_thread_posix.cc",
523 "threading/platform_thread_win.cc",
524 "threading/post_task_and_reply_impl.cc",
525 "threading/post_task_and_reply_impl.h",
526 "threading/sequenced_worker_pool.cc",
527 "threading/sequenced_worker_pool.h",
528 "threading/simple_thread.cc",
529 "threading/simple_thread.h",
530 "threading/thread.cc",
531 "threading/thread.h",
532 "threading/thread_checker.h",
533 "threading/thread_checker_impl.cc",
534 "threading/thread_checker_impl.h",
535 "threading/thread_collision_warner.cc",
536 "threading/thread_collision_warner.h",
537 "threading/thread_id_name_manager.cc",
538 "threading/thread_id_name_manager.h",
539 "threading/thread_local.h",
540 "threading/thread_local_android.cc",
541 "threading/thread_local_posix.cc",
542 "threading/thread_local_storage.cc",
543 "threading/thread_local_storage.h",
544 "threading/thread_local_storage_posix.cc",
545 "threading/thread_local_storage_win.cc",
546 "threading/thread_local_win.cc",
James Robinson646469d2014-10-03 15:33:28 -0700547 "threading/thread_restrictions.cc",
Etienne Membrives386015a2015-02-19 17:27:12 +0100548 "threading/thread_restrictions.h",
James Robinson646469d2014-10-03 15:33:28 -0700549 "threading/watchdog.cc",
550 "threading/watchdog.h",
James Robinson646469d2014-10-03 15:33:28 -0700551 "threading/worker_pool.cc",
Etienne Membrives386015a2015-02-19 17:27:12 +0100552 "threading/worker_pool.h",
James Robinson646469d2014-10-03 15:33:28 -0700553 "threading/worker_pool_posix.cc",
554 "threading/worker_pool_posix.h",
555 "threading/worker_pool_win.cc",
556 "time/clock.cc",
557 "time/clock.h",
558 "time/default_clock.cc",
559 "time/default_clock.h",
560 "time/default_tick_clock.cc",
561 "time/default_tick_clock.h",
562 "time/tick_clock.cc",
563 "time/tick_clock.h",
564 "time/time.cc",
565 "time/time.h",
566 "time/time_mac.cc",
567 "time/time_posix.cc",
568 "time/time_win.cc",
569 "timer/elapsed_timer.cc",
570 "timer/elapsed_timer.h",
571 "timer/hi_res_timer_manager.h",
572 "timer/hi_res_timer_manager_posix.cc",
573 "timer/hi_res_timer_manager_win.cc",
574 "timer/mock_timer.cc",
575 "timer/mock_timer.h",
576 "timer/timer.cc",
577 "timer/timer.h",
James Robinson646469d2014-10-03 15:33:28 -0700578 "tracked_objects.cc",
579 "tracked_objects.h",
580 "tracking_info.cc",
581 "tracking_info.h",
582 "tuple.h",
James Robinson646469d2014-10-03 15:33:28 -0700583 "value_conversions.cc",
584 "value_conversions.h",
Etienne Membrives386015a2015-02-19 17:27:12 +0100585 "values.cc",
586 "values.h",
James Robinson646469d2014-10-03 15:33:28 -0700587 "version.cc",
588 "version.h",
589 "vlog.cc",
590 "vlog.h",
591 "win/enum_variant.cc",
592 "win/enum_variant.h",
593 "win/event_trace_consumer.h",
594 "win/event_trace_controller.cc",
595 "win/event_trace_controller.h",
596 "win/event_trace_provider.cc",
597 "win/event_trace_provider.h",
598 "win/i18n.cc",
599 "win/i18n.h",
600 "win/iat_patch_function.cc",
601 "win/iat_patch_function.h",
602 "win/iunknown_impl.cc",
603 "win/iunknown_impl.h",
604 "win/message_window.cc",
605 "win/message_window.h",
606 "win/metro.cc",
607 "win/metro.h",
608 "win/object_watcher.cc",
609 "win/object_watcher.h",
610 "win/registry.cc",
611 "win/registry.h",
612 "win/resource_util.cc",
613 "win/resource_util.h",
614 "win/scoped_bstr.cc",
615 "win/scoped_bstr.h",
616 "win/scoped_co_mem.h",
617 "win/scoped_com_initializer.h",
618 "win/scoped_comptr.h",
619 "win/scoped_gdi_object.h",
620 "win/scoped_handle.cc",
621 "win/scoped_handle.h",
622 "win/scoped_hdc.h",
623 "win/scoped_hglobal.h",
624 "win/scoped_process_information.cc",
625 "win/scoped_process_information.h",
626 "win/scoped_propvariant.h",
627 "win/scoped_select_object.h",
628 "win/scoped_variant.cc",
629 "win/scoped_variant.h",
630 "win/shortcut.cc",
631 "win/shortcut.h",
632 "win/startup_information.cc",
633 "win/startup_information.h",
634 "win/win_util.cc",
635 "win/win_util.h",
636 "win/windows_version.cc",
637 "win/windows_version.h",
638 "win/wrapped_window_proc.cc",
639 "win/wrapped_window_proc.h",
640 ]
641
Nick Bray0bcbd3b2015-03-12 16:29:36 -0700642 sources -= [
643 "sys_info_freebsd.cc",
644 "sys_info_openbsd.cc",
645 ]
646
Dave Moore0ae79f42015-03-17 12:56:46 -0700647 configs += [ ":base_implementation" ]
Nick Bray0bcbd3b2015-03-12 16:29:36 -0700648
649 deps = [
650 ":base_static",
651 "//base/allocator:allocator_extension_thunks",
652 "//base/third_party/dynamic_annotations",
Nick Bray0bcbd3b2015-03-12 16:29:36 -0700653 "//third_party/modp_b64",
654 ]
655
656 public_deps = [
657 ":base_paths",
658 "//base/debug",
659 "//base/json",
660 "//base/memory",
661 "//base/metrics",
662 "//base/process",
663 "//base/trace_event",
664 ]
665
666 # Allow more direct string conversions on platforms with native utf8
667 # strings
668 if (is_mac || is_ios || is_chromeos) {
Dave Moore0ae79f42015-03-17 12:56:46 -0700669 defines = [ "SYSTEM_NATIVE_UTF8" ]
Nick Bray0bcbd3b2015-03-12 16:29:36 -0700670 }
671
672 if (is_android) {
673 sources -= [ "power_monitor/power_monitor_device_source_posix.cc" ]
674
675 # Android uses some Linux sources, put those back.
676 set_sources_assignment_filter([])
677 sources += [
678 "files/file_path_watcher_linux.cc",
679 "posix/unix_domain_socket_linux.cc",
680 "sys_info_linux.cc",
681 ]
682 set_sources_assignment_filter(sources_assignment_filter)
683
684 deps += [
685 ":base_jni_headers",
686 "//third_party/ashmem",
687 "//third_party/android_tools:cpu_features",
688 ]
689
690 # logging.cc uses the Android logging library.
691 libs = [ "log" ]
692 }
693
694 if (is_chromeos) {
695 sources -= [ "power_monitor/power_monitor_device_source_posix.cc" ]
696 }
697
James Robinson646469d2014-10-03 15:33:28 -0700698 if (is_nacl) {
Benjamin Lerman507bb1a2015-02-26 13:15:17 +0100699 # We reset sources_assignment_filter in order to explicitly include
700 # the linux file (which would otherwise be filtered out).
701 set_sources_assignment_filter([])
702 sources += [
703 "files/file_path_watcher_stub.cc",
704 "sync_socket_nacl.cc",
705 "threading/platform_thread_linux.cc",
706 ]
707 set_sources_assignment_filter(sources_assignment_filter)
708
709 sources -= [
710 "allocator/type_profiler_control.cc",
711 "allocator/type_profiler_control.h",
712 "async_socket_io_handler_posix.cc",
Benjamin Lerman507bb1a2015-02-26 13:15:17 +0100713 "cpu.cc",
Nick Bray0bcbd3b2015-03-12 16:29:36 -0700714 "files/file_enumerator_posix.cc",
Benjamin Lerman507bb1a2015-02-26 13:15:17 +0100715 "files/file_proxy.cc",
716 "files/file_util.cc",
James Robinson646469d2014-10-03 15:33:28 -0700717 "files/file_util_posix.cc",
Nick Bray0bcbd3b2015-03-12 16:29:36 -0700718 "files/file_util_proxy.cc",
719 "files/important_file_writer.cc",
720 "files/important_file_writer.h",
721 "files/scoped_temp_dir.cc",
James Robinson646469d2014-10-03 15:33:28 -0700722 "message_loop/message_pump_libevent.cc",
Etienne Membrives386015a2015-02-19 17:27:12 +0100723 "native_library_posix.cc",
Nick Bray0bcbd3b2015-03-12 16:29:36 -0700724 "path_service.cc",
Benjamin Lerman507bb1a2015-02-26 13:15:17 +0100725 "rand_util_posix.cc",
Nick Bray0bcbd3b2015-03-12 16:29:36 -0700726 "scoped_native_library.cc",
James Robinson646469d2014-10-03 15:33:28 -0700727 "sync_socket_posix.cc",
Nick Bray0bcbd3b2015-03-12 16:29:36 -0700728 "sys_info.cc",
James Robinson646469d2014-10-03 15:33:28 -0700729 "sys_info_posix.cc",
730 ]
731 } else {
Benjamin Lerman507bb1a2015-02-26 13:15:17 +0100732 # Remove NaCl stuff.
James Robinson646469d2014-10-03 15:33:28 -0700733 sources -= [
James Robinson646469d2014-10-03 15:33:28 -0700734 "os_compat_nacl.cc",
735 "os_compat_nacl.h",
736 "rand_util_nacl.cc",
James Robinson646469d2014-10-03 15:33:28 -0700737 ]
738 }
739
740 # Windows.
741 if (is_win) {
742 sources -= [
James Robinson646469d2014-10-03 15:33:28 -0700743 "message_loop/message_pump_libevent.cc",
744 "strings/string16.cc",
James Robinson6a64b812014-12-03 13:38:42 -0800745
James Robinson646469d2014-10-03 15:33:28 -0700746 # Not using sha1_win.cc because it may have caused a
747 # regression to page cycler moz.
748 "sha1_win.cc",
749 ]
750
751 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
Benjamin Lermane8ca9b72015-02-24 16:42:13 +0100752 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
James Robinson646469d2014-10-03 15:33:28 -0700753
754 libs = [
James Robinsone1b30cf2014-10-21 12:25:40 -0700755 "cfgmgr32.lib",
James Robinson646469d2014-10-03 15:33:28 -0700756 "netapi32.lib",
757 "powrprof.lib",
James Robinsone1b30cf2014-10-21 12:25:40 -0700758 "setupapi.lib",
James Robinson646469d2014-10-03 15:33:28 -0700759 ]
James Robinson0fae0002015-05-05 16:31:51 -0700760 all_dependent_configs = [ ":base_win_linker_flags" ]
James Robinson646469d2014-10-03 15:33:28 -0700761 } else if (!is_nacl) {
762 # Non-Windows.
763 deps += [ "//third_party/libevent" ]
764 }
765
766 # Mac.
767 if (is_mac) {
James Robinson646469d2014-10-03 15:33:28 -0700768 sources -= [
James Robinson646469d2014-10-03 15:33:28 -0700769 "native_library_posix.cc",
770 "strings/sys_string_conversions_posix.cc",
Alhaad Gokhale4f513072015-03-24 10:49:34 -0700771 "threading/platform_thread_internal_posix.cc",
James Robinson646469d2014-10-03 15:33:28 -0700772 ]
James Robinson646469d2014-10-03 15:33:28 -0700773 } else {
774 # Non-Mac.
775 sources -= [
776 "files/file_path_watcher_fsevents.cc",
777 "files/file_path_watcher_fsevents.h",
778 "files/file_path_watcher_kqueue.cc",
779 "files/file_path_watcher_kqueue.h",
780 ]
781 }
782
783 # Linux.
784 if (is_linux) {
785 # TODO(brettw) this will need to be parameterized at some point.
James Robinson5e66a792015-01-21 17:02:08 -0800786 linux_configs = []
787 if (use_glib) {
788 linux_configs += [ "//build/config/linux:glib" ]
789 }
James Robinson646469d2014-10-03 15:33:28 -0700790
791 configs += linux_configs
792 all_dependent_configs = linux_configs
793
James Robinson646469d2014-10-03 15:33:28 -0700794 # These dependencies are not required on Android, and in the case
795 # of xdg_mime must be excluded due to licensing restrictions.
796 deps += [
James Robinson646469d2014-10-03 15:33:28 -0700797 "//base/third_party/xdg_mime",
798 "//base/third_party/xdg_user_dirs",
799 ]
800 } else {
801 # Non-Linux.
802 sources -= [
803 "nix/mime_util_xdg.cc",
804 "nix/mime_util_xdg.h",
805 "nix/xdg_util.cc",
806 "nix/xdg_util.h",
807 ]
808
809 if (!is_android) {
810 sources -= [
811 "linux_util.cc",
812 "linux_util.h",
813 ]
814 }
815 }
816
817 if (!use_glib) {
818 sources -= [
819 "message_loop/message_pump_glib.cc",
820 "message_loop/message_pump_glib.h",
821 ]
822 }
823
824 configs += [ "//build/config/compiler:wexit_time_destructors" ]
825 if (is_android && !is_debug) {
826 configs -= [ "//build/config/compiler:optimize" ]
827 configs += [ "//build/config/compiler:optimize_max" ]
828 }
Nick Bray0bcbd3b2015-03-12 16:29:36 -0700829
830 allow_circular_includes_from = public_deps
James Robinson646469d2014-10-03 15:33:28 -0700831}
832
833# This is the subset of files from base that should not be used with a dynamic
834# library. Note that this library cannot depend on base because base depends on
835# base_static.
836source_set("base_static") {
837 sources = [
838 "base_switches.cc",
839 "base_switches.h",
840 "win/pe_image.cc",
841 "win/pe_image.h",
842 ]
843
844 if (is_android && !is_debug) {
845 configs -= [ "//build/config/compiler:optimize" ]
846 configs += [ "//build/config/compiler:optimize_max" ]
847 }
848}
849
850component("i18n") {
851 output_name = "base_i18n"
852 sources = [
853 "i18n/base_i18n_export.h",
854 "i18n/bidi_line_iterator.cc",
855 "i18n/bidi_line_iterator.h",
856 "i18n/break_iterator.cc",
857 "i18n/break_iterator.h",
858 "i18n/case_conversion.cc",
859 "i18n/case_conversion.h",
860 "i18n/char_iterator.cc",
861 "i18n/char_iterator.h",
862 "i18n/file_util_icu.cc",
863 "i18n/file_util_icu.h",
864 "i18n/i18n_constants.cc",
865 "i18n/i18n_constants.h",
866 "i18n/icu_encoding_detection.cc",
867 "i18n/icu_encoding_detection.h",
868 "i18n/icu_string_conversions.cc",
869 "i18n/icu_string_conversions.h",
870 "i18n/icu_util.cc",
871 "i18n/icu_util.h",
872 "i18n/number_formatting.cc",
873 "i18n/number_formatting.h",
874 "i18n/rtl.cc",
875 "i18n/rtl.h",
876 "i18n/streaming_utf8_validator.cc",
877 "i18n/streaming_utf8_validator.h",
878 "i18n/string_compare.cc",
879 "i18n/string_compare.h",
880 "i18n/string_search.cc",
881 "i18n/string_search.h",
882 "i18n/time_formatting.cc",
883 "i18n/time_formatting.h",
884 "i18n/timezone.cc",
885 "i18n/timezone.h",
886 "i18n/utf8_validator_tables.cc",
887 "i18n/utf8_validator_tables.h",
888 ]
889 defines = [ "BASE_I18N_IMPLEMENTATION" ]
890 configs += [ "//build/config/compiler:wexit_time_destructors" ]
891 deps = [
892 ":base",
893 "//base/third_party/dynamic_annotations",
894 "//third_party/icu",
895 ]
896
897 if (is_android && !is_debug) {
898 configs -= [ "//build/config/compiler:optimize" ]
899 configs += [ "//build/config/compiler:optimize_max" ]
900 }
John Abd-El-Malek726443c2014-11-07 19:27:02 -0800901
Benjamin Lermane8ca9b72015-02-24 16:42:13 +0100902 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
903 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
James Robinson646469d2014-10-03 15:33:28 -0700904}
905
James Robinson0fae0002015-05-05 16:31:51 -0700906if (is_win || (is_linux && !is_chromeos)) {
Nick Bray0bcbd3b2015-03-12 16:29:36 -0700907 # TODO(GYP): Figure out which of these work and are needed on other platforms.
908 test("base_perftests") {
909 sources = [
910 "message_loop/message_pump_perftest.cc",
911
912 # "test/run_all_unittests.cc",
913 "threading/thread_perftest.cc",
914 ]
915 deps = [
916 ":base",
917 "//base/test:test_support",
918 "//base/test:test_support_perf",
919 "//testing/perf",
920 "//testing/gtest",
921 ]
922
923 if (is_android) {
James Robinson0fae0002015-05-05 16:31:51 -0700924 deps += [ "//testing/android/native_test:native_test_native_code" ]
Nick Bray0bcbd3b2015-03-12 16:29:36 -0700925 }
926 }
927
928 test("base_i18n_perftests") {
929 sources = [
930 "i18n/streaming_utf8_validator_perftest.cc",
931 ]
932 deps = [
933 ":base",
934 ":i18n",
935 "//base/test:test_support",
936 "//base/test:test_support_perf",
937 "//testing/gtest",
938 ]
939 }
940
941 if (!is_ios) {
942 executable("build_utf8_validator_tables") {
943 sources = [
944 "i18n/build_utf8_validator_tables.cc",
945 ]
946 deps = [
947 ":base",
948 "//third_party/icu:icuuc",
949 ]
950 }
951
952 executable("check_example") {
953 sources = [
954 "check_example.cc",
955 ]
956 deps = [
957 ":base",
958 ]
959 }
960 }
961}
962
James Robinson0fae0002015-05-05 16:31:51 -0700963component("prefs") {
James Robinson646469d2014-10-03 15:33:28 -0700964 sources = [
965 "prefs/base_prefs_export.h",
966 "prefs/default_pref_store.cc",
967 "prefs/default_pref_store.h",
968 "prefs/json_pref_store.cc",
969 "prefs/json_pref_store.h",
970 "prefs/overlay_user_pref_store.cc",
971 "prefs/overlay_user_pref_store.h",
972 "prefs/persistent_pref_store.h",
973 "prefs/pref_change_registrar.cc",
974 "prefs/pref_change_registrar.h",
975 "prefs/pref_filter.h",
976 "prefs/pref_member.cc",
977 "prefs/pref_member.h",
978 "prefs/pref_notifier.h",
979 "prefs/pref_notifier_impl.cc",
980 "prefs/pref_notifier_impl.h",
981 "prefs/pref_observer.h",
982 "prefs/pref_registry.cc",
983 "prefs/pref_registry.h",
984 "prefs/pref_registry_simple.cc",
985 "prefs/pref_registry_simple.h",
986 "prefs/pref_service.cc",
987 "prefs/pref_service.h",
988 "prefs/pref_service_factory.cc",
989 "prefs/pref_service_factory.h",
990 "prefs/pref_store.cc",
991 "prefs/pref_store.h",
992 "prefs/pref_value_map.cc",
993 "prefs/pref_value_map.h",
994 "prefs/pref_value_store.cc",
995 "prefs/pref_value_store.h",
996 "prefs/scoped_user_pref_update.cc",
997 "prefs/scoped_user_pref_update.h",
998 "prefs/value_map_pref_store.cc",
999 "prefs/value_map_pref_store.h",
1000 "prefs/writeable_pref_store.h",
1001 ]
1002
1003 defines = [ "BASE_PREFS_IMPLEMENTATION" ]
1004
James Robinson6a64b812014-12-03 13:38:42 -08001005 deps = [
1006 ":base",
1007 ]
James Robinson646469d2014-10-03 15:33:28 -07001008
1009 if (is_android && !is_debug) {
1010 configs -= [ "//build/config/compiler:optimize" ]
1011 configs += [ "//build/config/compiler:optimize_max" ]
1012 }
1013}
1014
1015source_set("prefs_test_support") {
1016 testonly = true
1017 sources = [
1018 "prefs/mock_pref_change_callback.cc",
1019 "prefs/mock_pref_change_callback.h",
1020 "prefs/pref_store_observer_mock.cc",
1021 "prefs/pref_store_observer_mock.h",
1022 "prefs/testing_pref_service.cc",
1023 "prefs/testing_pref_service.h",
1024 "prefs/testing_pref_store.cc",
1025 "prefs/testing_pref_store.h",
1026 ]
1027
James Robinson6a64b812014-12-03 13:38:42 -08001028 public_deps = [
1029 ":prefs",
1030 ]
James Robinson646469d2014-10-03 15:33:28 -07001031 deps = [
1032 ":base",
James Robinson646469d2014-10-03 15:33:28 -07001033 "//testing/gmock",
1034 "//testing/gtest",
1035 ]
1036}
1037
1038source_set("message_loop_tests") {
1039 testonly = true
1040 sources = [
1041 "message_loop/message_loop_test.cc",
1042 "message_loop/message_loop_test.h",
1043 ]
1044
1045 deps = [
1046 ":base",
1047 "//testing/gtest",
1048 ]
1049}
1050
Benjamin Lerman507bb1a2015-02-26 13:15:17 +01001051if (is_win) {
Dave Moorecc0e4f92015-03-10 15:23:04 -07001052 # Target to manually rebuild pe_image_test.dll which is checked into
1053 # base/test/data/pe_image.
Benjamin Lerman507bb1a2015-02-26 13:15:17 +01001054 shared_library("pe_image_test") {
1055 sources = [
1056 "win/pe_image_test.cc",
1057 ]
1058 ldflags = [
1059 "/DELAYLOAD:cfgmgr32.dll",
1060 "/DELAYLOAD:shell32.dll",
1061 "/SUBSYSTEM:WINDOWS",
1062 ]
1063 libs = [
1064 "cfgmgr32.lib",
1065 "shell32.lib",
1066 ]
1067 }
1068}
1069
James Robinson646469d2014-10-03 15:33:28 -07001070test("base_unittests") {
1071 sources = [
1072 "android/application_status_listener_unittest.cc",
James Robinson6a64b812014-12-03 13:38:42 -08001073 "android/content_uri_utils_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001074 "android/jni_android_unittest.cc",
1075 "android/jni_array_unittest.cc",
1076 "android/jni_string_unittest.cc",
James Robinsonf19b1022015-05-05 18:12:15 -07001077 "android/library_loader/library_prefetcher_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001078 "android/path_utils_unittest.cc",
1079 "android/scoped_java_ref_unittest.cc",
1080 "android/sys_utils_unittest.cc",
1081 "async_socket_io_handler_unittest.cc",
1082 "at_exit_unittest.cc",
1083 "atomicops_unittest.cc",
1084 "barrier_closure_unittest.cc",
1085 "base64_unittest.cc",
1086 "big_endian_unittest.cc",
1087 "bind_unittest.cc",
1088 "bind_unittest.nc",
1089 "bits_unittest.cc",
1090 "build_time_unittest.cc",
1091 "callback_helpers_unittest.cc",
1092 "callback_list_unittest.cc",
1093 "callback_list_unittest.nc",
1094 "callback_unittest.cc",
1095 "callback_unittest.nc",
1096 "cancelable_callback_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001097 "command_line_unittest.cc",
1098 "containers/adapters_unittest.cc",
1099 "containers/hash_tables_unittest.cc",
1100 "containers/linked_list_unittest.cc",
1101 "containers/mru_cache_unittest.cc",
James Robinsonf19b1022015-05-05 18:12:15 -07001102 "containers/scoped_ptr_hash_map_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001103 "containers/small_map_unittest.cc",
1104 "containers/stack_container_unittest.cc",
1105 "cpu_unittest.cc",
1106 "debug/crash_logging_unittest.cc",
James Robinson1027bc12014-12-04 14:51:42 -08001107 "debug/debugger_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001108 "debug/leak_tracker_unittest.cc",
1109 "debug/proc_maps_linux_unittest.cc",
1110 "debug/stack_trace_unittest.cc",
1111 "debug/task_annotator_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001112 "deferred_sequenced_task_runner_unittest.cc",
1113 "environment_unittest.cc",
1114 "file_version_info_unittest.cc",
1115 "files/dir_reader_posix_unittest.cc",
1116 "files/file_path_unittest.cc",
James Robinson0fae0002015-05-05 16:31:51 -07001117 "files/file_path_watcher_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001118 "files/file_proxy_unittest.cc",
1119 "files/file_unittest.cc",
1120 "files/file_util_proxy_unittest.cc",
1121 "files/file_util_unittest.cc",
1122 "files/important_file_writer_unittest.cc",
1123 "files/scoped_temp_dir_unittest.cc",
1124 "gmock_unittest.cc",
1125 "guid_unittest.cc",
1126 "hash_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001127 "i18n/break_iterator_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001128 "i18n/case_conversion_unittest.cc",
Etienne Membrives386015a2015-02-19 17:27:12 +01001129 "i18n/char_iterator_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001130 "i18n/file_util_icu_unittest.cc",
1131 "i18n/icu_string_conversions_unittest.cc",
1132 "i18n/number_formatting_unittest.cc",
1133 "i18n/rtl_unittest.cc",
1134 "i18n/streaming_utf8_validator_unittest.cc",
1135 "i18n/string_search_unittest.cc",
1136 "i18n/time_formatting_unittest.cc",
1137 "i18n/timezone_unittest.cc",
Etienne Membrives386015a2015-02-19 17:27:12 +01001138 "id_map_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001139 "ios/device_util_unittest.mm",
Etienne Membrivesb1556b32014-12-16 13:56:09 +01001140 "ios/weak_nsobject_unittest.mm",
James Robinson646469d2014-10-03 15:33:28 -07001141 "json/json_parser_unittest.cc",
1142 "json/json_reader_unittest.cc",
1143 "json/json_value_converter_unittest.cc",
1144 "json/json_value_serializer_unittest.cc",
1145 "json/json_writer_unittest.cc",
1146 "json/string_escape_unittest.cc",
1147 "lazy_instance_unittest.cc",
1148 "logging_unittest.cc",
1149 "mac/bind_objc_block_unittest.mm",
James Robinsonc8f302a2015-05-14 16:38:33 -07001150 "mac/dispatch_source_mach_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001151 "mac/foundation_util_unittest.mm",
1152 "mac/libdispatch_task_runner_unittest.cc",
1153 "mac/mac_util_unittest.mm",
1154 "mac/objc_property_releaser_unittest.mm",
1155 "mac/scoped_nsobject_unittest.mm",
1156 "mac/scoped_objc_class_swizzler_unittest.mm",
1157 "mac/scoped_sending_event_unittest.mm",
1158 "md5_unittest.cc",
1159 "memory/aligned_memory_unittest.cc",
James Robinson61650152014-10-26 23:24:55 -07001160 "memory/discardable_shared_memory_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001161 "memory/linked_ptr_unittest.cc",
Viet-Trung Luu235cf3d2015-06-11 10:01:25 -07001162 "memory/memory_pressure_monitor_chromeos_unittest.cc",
1163 "memory/memory_pressure_monitor_win_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001164 "memory/ref_counted_memory_unittest.cc",
1165 "memory/ref_counted_unittest.cc",
1166 "memory/scoped_ptr_unittest.cc",
1167 "memory/scoped_ptr_unittest.nc",
1168 "memory/scoped_vector_unittest.cc",
1169 "memory/shared_memory_unittest.cc",
1170 "memory/singleton_unittest.cc",
1171 "memory/weak_ptr_unittest.cc",
1172 "memory/weak_ptr_unittest.nc",
1173 "message_loop/message_loop_proxy_impl_unittest.cc",
1174 "message_loop/message_loop_proxy_unittest.cc",
1175 "message_loop/message_loop_unittest.cc",
1176 "message_loop/message_pump_glib_unittest.cc",
1177 "message_loop/message_pump_io_ios_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001178 "metrics/bucket_ranges_unittest.cc",
1179 "metrics/field_trial_unittest.cc",
1180 "metrics/histogram_base_unittest.cc",
1181 "metrics/histogram_delta_serialization_unittest.cc",
1182 "metrics/histogram_snapshot_manager_unittest.cc",
1183 "metrics/histogram_unittest.cc",
Etienne Membrives386015a2015-02-19 17:27:12 +01001184 "metrics/sample_map_unittest.cc",
1185 "metrics/sample_vector_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001186 "metrics/sparse_histogram_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001187 "metrics/statistics_recorder_unittest.cc",
James Robinson0fae0002015-05-05 16:31:51 -07001188 "move_unittest.cc",
Etienne Membrives386015a2015-02-19 17:27:12 +01001189 "numerics/safe_numerics_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001190 "observer_list_unittest.cc",
1191 "os_compat_android_unittest.cc",
1192 "path_service_unittest.cc",
1193 "pickle_unittest.cc",
1194 "posix/file_descriptor_shuffle_unittest.cc",
1195 "posix/unix_domain_socket_linux_unittest.cc",
1196 "power_monitor/power_monitor_unittest.cc",
1197 "prefs/default_pref_store_unittest.cc",
1198 "prefs/json_pref_store_unittest.cc",
1199 "prefs/overlay_user_pref_store_unittest.cc",
1200 "prefs/pref_change_registrar_unittest.cc",
1201 "prefs/pref_member_unittest.cc",
1202 "prefs/pref_notifier_impl_unittest.cc",
1203 "prefs/pref_service_unittest.cc",
1204 "prefs/pref_value_map_unittest.cc",
1205 "prefs/pref_value_store_unittest.cc",
1206 "prefs/scoped_user_pref_update_unittest.cc",
1207 "process/memory_unittest.cc",
1208 "process/memory_unittest_mac.h",
1209 "process/memory_unittest_mac.mm",
1210 "process/process_metrics_unittest.cc",
1211 "process/process_metrics_unittest_ios.cc",
James Robinsond4531882014-10-17 16:14:32 -07001212 "process/process_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001213 "process/process_util_unittest.cc",
1214 "process/process_util_unittest_ios.cc",
Alhaad Gokhale4f513072015-03-24 10:49:34 -07001215 "profiler/stack_sampling_profiler_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001216 "profiler/tracked_time_unittest.cc",
1217 "rand_util_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001218 "scoped_clear_errno_unittest.cc",
1219 "scoped_generic_unittest.cc",
1220 "scoped_native_library_unittest.cc",
1221 "security_unittest.cc",
1222 "sequence_checker_unittest.cc",
1223 "sha1_unittest.cc",
1224 "stl_util_unittest.cc",
1225 "strings/nullable_string16_unittest.cc",
1226 "strings/safe_sprintf_unittest.cc",
1227 "strings/string16_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001228 "strings/string_number_conversions_unittest.cc",
1229 "strings/string_piece_unittest.cc",
1230 "strings/string_split_unittest.cc",
1231 "strings/string_tokenizer_unittest.cc",
1232 "strings/string_util_unittest.cc",
1233 "strings/stringize_macros_unittest.cc",
Etienne Membrives386015a2015-02-19 17:27:12 +01001234 "strings/stringprintf_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001235 "strings/sys_string_conversions_mac_unittest.mm",
1236 "strings/sys_string_conversions_unittest.cc",
1237 "strings/utf_offset_string_conversions_unittest.cc",
1238 "strings/utf_string_conversions_unittest.cc",
1239 "supports_user_data_unittest.cc",
1240 "sync_socket_unittest.cc",
1241 "synchronization/cancellation_flag_unittest.cc",
1242 "synchronization/condition_variable_unittest.cc",
1243 "synchronization/lock_unittest.cc",
1244 "synchronization/waitable_event_unittest.cc",
1245 "synchronization/waitable_event_watcher_unittest.cc",
1246 "sys_info_unittest.cc",
1247 "system_monitor/system_monitor_unittest.cc",
1248 "task/cancelable_task_tracker_unittest.cc",
1249 "task_runner_util_unittest.cc",
1250 "template_util_unittest.cc",
1251 "test/expectations/expectation_unittest.cc",
1252 "test/expectations/parser_unittest.cc",
1253 "test/histogram_tester_unittest.cc",
1254 "test/test_reg_util_win_unittest.cc",
1255 "test/trace_event_analyzer_unittest.cc",
James Robinson0fae0002015-05-05 16:31:51 -07001256 "test/user_action_tester_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001257 "threading/non_thread_safe_unittest.cc",
1258 "threading/platform_thread_unittest.cc",
1259 "threading/sequenced_worker_pool_unittest.cc",
1260 "threading/simple_thread_unittest.cc",
1261 "threading/thread_checker_unittest.cc",
1262 "threading/thread_collision_warner_unittest.cc",
1263 "threading/thread_id_name_manager_unittest.cc",
1264 "threading/thread_local_storage_unittest.cc",
1265 "threading/thread_local_unittest.cc",
1266 "threading/thread_unittest.cc",
1267 "threading/watchdog_unittest.cc",
1268 "threading/worker_pool_posix_unittest.cc",
1269 "threading/worker_pool_unittest.cc",
1270 "time/pr_time_unittest.cc",
1271 "time/time_unittest.cc",
1272 "time/time_win_unittest.cc",
1273 "timer/hi_res_timer_manager_unittest.cc",
1274 "timer/mock_timer_unittest.cc",
1275 "timer/timer_unittest.cc",
1276 "tools_sanity_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001277 "tracked_objects_unittest.cc",
1278 "tuple_unittest.cc",
1279 "values_unittest.cc",
1280 "version_unittest.cc",
1281 "vlog_unittest.cc",
1282 "win/dllmain.cc",
1283 "win/enum_variant_unittest.cc",
1284 "win/event_trace_consumer_unittest.cc",
1285 "win/event_trace_controller_unittest.cc",
1286 "win/event_trace_provider_unittest.cc",
1287 "win/i18n_unittest.cc",
1288 "win/iunknown_impl_unittest.cc",
1289 "win/message_window_unittest.cc",
1290 "win/object_watcher_unittest.cc",
1291 "win/pe_image_unittest.cc",
1292 "win/registry_unittest.cc",
1293 "win/scoped_bstr_unittest.cc",
1294 "win/scoped_comptr_unittest.cc",
1295 "win/scoped_process_information_unittest.cc",
1296 "win/scoped_variant_unittest.cc",
1297 "win/shortcut_unittest.cc",
1298 "win/startup_information_unittest.cc",
1299 "win/win_util_unittest.cc",
1300 "win/wrapped_window_proc_unittest.cc",
1301 ]
1302
1303 deps = [
1304 ":base",
1305 ":i18n",
1306 ":message_loop_tests",
1307 ":prefs",
1308 ":prefs_test_support",
1309 "//base/allocator",
1310 "//base/test:run_all_unittests",
1311 "//base/test:test_support",
1312 "//base/third_party/dynamic_annotations",
Alhaad Gokhale4f513072015-03-24 10:49:34 -07001313 "//base/trace_event:trace_event_unittests",
James Robinson646469d2014-10-03 15:33:28 -07001314 "//testing/gmock",
1315 "//testing/gtest",
1316 "//third_party/icu",
1317 ]
1318
Viet-Trung Luu235cf3d2015-06-11 10:01:25 -07001319 data = [
1320 "test/data/",
1321
1322 # TODO(dpranke): Remove when icu declares this directly.
1323 "$root_out_dir/icudtl.dat",
1324 ]
1325
Nick Bray0bcbd3b2015-03-12 16:29:36 -07001326 # Allow more direct string conversions on platforms with native utf8
1327 # strings
1328 if (is_mac || is_ios || is_chromeos) {
Dave Moore0ae79f42015-03-17 12:56:46 -07001329 defines = [ "SYSTEM_NATIVE_UTF8" ]
Nick Bray0bcbd3b2015-03-12 16:29:36 -07001330 }
1331
James Robinson5e66a792015-01-21 17:02:08 -08001332 if (is_android) {
1333 apk_deps = [
1334 ":base_java",
1335 ":base_java_unittest_support",
1336 ]
Viet-Trung Luu235cf3d2015-06-11 10:01:25 -07001337 isolate_file = "base_unittests.isolate"
James Robinson5e66a792015-01-21 17:02:08 -08001338 }
1339
James Robinson646469d2014-10-03 15:33:28 -07001340 if (is_ios) {
1341 sources -= [
James Robinson646469d2014-10-03 15:33:28 -07001342 "process/memory_unittest.cc",
1343 "process/memory_unittest_mac.h",
1344 "process/memory_unittest_mac.mm",
James Robinsond4531882014-10-17 16:14:32 -07001345 "process/process_unittest.cc",
James Robinson646469d2014-10-03 15:33:28 -07001346 "process/process_util_unittest.cc",
1347 ]
1348
1349 # Pull in specific Mac files for iOS (which have been filtered out by file
1350 # name rules).
1351 set_sources_assignment_filter([])
1352 sources += [
1353 "mac/bind_objc_block_unittest.mm",
1354 "mac/foundation_util_unittest.mm",
1355 "mac/objc_property_releaser_unittest.mm",
1356 "mac/scoped_nsobject_unittest.mm",
1357 "sys_string_conversions_mac_unittest.mm",
1358 ]
1359 set_sources_assignment_filter(sources_assignment_filter)
1360
1361 # TODO(GYP): dep on copy_test_data_ios action.
1362 }
1363
1364 if (is_linux) {
1365 sources -= [ "file_version_info_unittest.cc" ]
1366 sources += [ "nix/xdg_util_unittest.cc" ]
James Robinson0fae0002015-05-05 16:31:51 -07001367 deps += [ "//base/test:malloc_wrapper" ]
1368
James Robinson5e66a792015-01-21 17:02:08 -08001369 if (use_glib) {
1370 configs += [ "//build/config/linux:glib" ]
1371 }
James Robinson646469d2014-10-03 15:33:28 -07001372 }
1373
James Robinson5e66a792015-01-21 17:02:08 -08001374 if (!is_linux || use_ozone) {
James Robinson646469d2014-10-03 15:33:28 -07001375 sources -= [ "message_loop/message_pump_glib_unittest.cc" ]
1376 }
1377
1378 if (is_posix || is_ios) {
1379 sources += [ "message_loop/message_pump_libevent_unittest.cc" ]
1380 deps += [ "//third_party/libevent" ]
1381 }
1382
1383 if (is_android) {
James Robinson0fae0002015-05-05 16:31:51 -07001384 deps += [ "//testing/android/native_test:native_test_native_code" ]
James Robinson646469d2014-10-03 15:33:28 -07001385 set_sources_assignment_filter([])
1386 sources += [ "debug/proc_maps_linux_unittest.cc" ]
1387 set_sources_assignment_filter(sources_assignment_filter)
1388 }
Benjamin Lerman57998902014-11-18 16:06:02 +01001389
Benjamin Lermane8ca9b72015-02-24 16:42:13 +01001390 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1391 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
James Robinson646469d2014-10-03 15:33:28 -07001392}
1393
1394if (is_android) {
1395 # GYP: //base.gyp:base_jni_headers
1396 generate_jni("base_jni_headers") {
1397 sources = [
Dave Moorecc0e4f92015-03-10 15:23:04 -07001398 "android/java/src/org/chromium/base/AnimationFrameTimeHistogram.java",
Viet-Trung Luu235cf3d2015-06-11 10:01:25 -07001399 "android/java/src/org/chromium/base/ApkAssets.java",
Nick Bray0bcbd3b2015-03-12 16:29:36 -07001400 "android/java/src/org/chromium/base/ApplicationStatus.java",
James Robinson646469d2014-10-03 15:33:28 -07001401 "android/java/src/org/chromium/base/BuildInfo.java",
1402 "android/java/src/org/chromium/base/CommandLine.java",
1403 "android/java/src/org/chromium/base/ContentUriUtils.java",
1404 "android/java/src/org/chromium/base/CpuFeatures.java",
1405 "android/java/src/org/chromium/base/EventLog.java",
1406 "android/java/src/org/chromium/base/FieldTrialList.java",
1407 "android/java/src/org/chromium/base/ImportantFileWriterAndroid.java",
1408 "android/java/src/org/chromium/base/JNIUtils.java",
Benjamin Lermandf06e5f2015-01-22 13:22:57 +01001409 "android/java/src/org/chromium/base/JavaHandlerThread.java",
James Robinson24218d72014-10-20 16:18:41 -07001410 "android/java/src/org/chromium/base/LocaleUtils.java",
James Robinson646469d2014-10-03 15:33:28 -07001411 "android/java/src/org/chromium/base/MemoryPressureListener.java",
James Robinson646469d2014-10-03 15:33:28 -07001412 "android/java/src/org/chromium/base/PathService.java",
1413 "android/java/src/org/chromium/base/PathUtils.java",
1414 "android/java/src/org/chromium/base/PowerMonitor.java",
James Robinson646469d2014-10-03 15:33:28 -07001415 "android/java/src/org/chromium/base/SysUtils.java",
Benjamin Lermandf06e5f2015-01-22 13:22:57 +01001416 "android/java/src/org/chromium/base/SystemMessageHandler.java",
James Robinson646469d2014-10-03 15:33:28 -07001417 "android/java/src/org/chromium/base/ThreadUtils.java",
1418 "android/java/src/org/chromium/base/TraceEvent.java",
Benjamin Lermandf06e5f2015-01-22 13:22:57 +01001419 "android/java/src/org/chromium/base/library_loader/LibraryLoader.java",
1420 "android/java/src/org/chromium/base/metrics/RecordHistogram.java",
James Robinson0fae0002015-05-05 16:31:51 -07001421 "android/java/src/org/chromium/base/metrics/RecordUserAction.java",
James Robinson646469d2014-10-03 15:33:28 -07001422 ]
James Robinson0fae0002015-05-05 16:31:51 -07001423
1424 deps = [
1425 ":android_runtime_jni_headers",
1426 ]
1427
James Robinson646469d2014-10-03 15:33:28 -07001428 jni_package = "base"
1429 }
1430
James Robinson0fae0002015-05-05 16:31:51 -07001431 # GYP: //base.gyp:android_runtime_jni_headers
1432 generate_jar_jni("android_runtime_jni_headers") {
1433 jni_package = "base"
1434 classes = [ "java/lang/Runtime.class" ]
1435 }
1436
James Robinson646469d2014-10-03 15:33:28 -07001437 # GYP: //base.gyp:base_java
1438 android_library("base_java") {
1439 srcjar_deps = [
James Robinson30d547e2014-10-23 18:20:06 -07001440 ":base_android_java_enums_srcjar",
James Robinson646469d2014-10-03 15:33:28 -07001441 ":base_native_libraries_gen",
1442 ]
1443
1444 deps = [
James Robinson6a64b812014-12-03 13:38:42 -08001445 "//third_party/jsr-305:jsr_305_javalib",
James Robinson646469d2014-10-03 15:33:28 -07001446 ]
1447
1448 DEPRECATED_java_in_dir = "android/java/src"
1449
1450 # A new version of NativeLibraries.java (with the actual correct values)
1451 # will be created when creating an apk.
1452 jar_excluded_patterns = [
1453 "*/NativeLibraries.class",
1454 "*/NativeLibraries##*.class",
1455 ]
1456 }
1457
1458 # GYP: //base.gyp:base_javatests
1459 android_library("base_javatests") {
1460 deps = [
1461 ":base_java",
1462 ":base_java_test_support",
1463 ]
1464 DEPRECATED_java_in_dir = "android/javatests/src"
1465 }
1466
1467 # GYP: //base.gyp:base_java_test_support
1468 android_library("base_java_test_support") {
1469 deps = [
1470 ":base_java",
James Robinsonf19b1022015-05-05 18:12:15 -07001471 "//testing/android/reporter:reporter_java",
James Robinson646469d2014-10-03 15:33:28 -07001472 ]
1473 DEPRECATED_java_in_dir = "test/android/javatests/src"
1474 }
1475
James Robinson0fae0002015-05-05 16:31:51 -07001476 # GYP: //base.gyp:base_junit_tests
1477 junit_binary("base_junit_tests") {
1478 java_files = [ "android/junit/src/org/chromium/base/LogTest.java" ]
1479 deps = [
1480 ":base_java",
1481 ":base_java_test_support",
1482 ]
1483 }
1484
James Robinson646469d2014-10-03 15:33:28 -07001485 # GYP: //base.gyp:base_java_application_state
James Robinson53b77582014-10-28 17:00:48 -07001486 # GYP: //base.gyp:base_java_library_load_from_apk_status_codes
Etienne Membrives386015a2015-02-19 17:27:12 +01001487 # GYP: //base.gyp:base_java_library_process_type
James Robinson30d547e2014-10-23 18:20:06 -07001488 # GYP: //base.gyp:base_java_memory_pressure_level
1489 java_cpp_enum("base_android_java_enums_srcjar") {
James Robinson646469d2014-10-03 15:33:28 -07001490 sources = [
James Robinson30d547e2014-10-23 18:20:06 -07001491 "android/application_status_listener.h",
James Robinson53b77582014-10-28 17:00:48 -07001492 "android/library_loader/library_load_from_apk_status_codes.h",
Etienne Membrives386015a2015-02-19 17:27:12 +01001493 "android/library_loader/library_loader_hooks.h",
James Robinson30d547e2014-10-23 18:20:06 -07001494 "memory/memory_pressure_listener.h",
James Robinson646469d2014-10-03 15:33:28 -07001495 ]
James Robinson30d547e2014-10-23 18:20:06 -07001496 outputs = [
1497 "org/chromium/base/ApplicationState.java",
James Robinson53b77582014-10-28 17:00:48 -07001498 "org/chromium/base/library_loader/LibraryLoadFromApkStatusCodes.java",
Etienne Membrives386015a2015-02-19 17:27:12 +01001499 "org/chromium/base/library_loader/LibraryProcessType.java",
James Robinson30d547e2014-10-23 18:20:06 -07001500 "org/chromium/base/MemoryPressureLevel.java",
James Robinson646469d2014-10-03 15:33:28 -07001501 ]
James Robinson646469d2014-10-03 15:33:28 -07001502 }
1503
1504 # GYP: //base/base.gyp:base_native_libraries_gen
1505 java_cpp_template("base_native_libraries_gen") {
1506 sources = [
1507 "android/java/templates/NativeLibraries.template",
1508 ]
1509 package_name = "org/chromium/base/library_loader"
1510 }
1511
1512 # GYP: //base.gyp:base_java_unittest_support
1513 android_library("base_java_unittest_support") {
James Robinson6a64b812014-12-03 13:38:42 -08001514 deps = [
1515 ":base_java",
James Robinson646469d2014-10-03 15:33:28 -07001516 ]
James Robinson6a64b812014-12-03 13:38:42 -08001517 java_files =
1518 [ "test/android/java/src/org/chromium/base/ContentUriTestUtils.java" ]
James Robinson646469d2014-10-03 15:33:28 -07001519 }
James Robinson646469d2014-10-03 15:33:28 -07001520}