Roll src/third_party/WebKit eac3800:0237a66 (svn 202606:202607)
[chromium-blink-merge.git] / base / base.gyp
blob2b97511a138862774f1ef3361349e79eabd6a096
1 # Copyright (c) 2012 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.
6   'variables': {
7     'chromium_code': 1,
8   },
9   'includes': [
10     '../build/win_precompile.gypi',
11     'base.gypi',
12   ],
13   'targets': [
14     {
15       'target_name': 'base',
16       'type': '<(component)',
17       'toolsets': ['host', 'target'],
18       'variables': {
19         'base_target': 1,
20         'enable_wexit_time_destructors': 1,
21         'optimize': 'max',
22       },
23       'dependencies': [
24         'base_static',
25         'allocator/allocator.gyp:allocator_extension_thunks',
26         '../testing/gtest.gyp:gtest_prod',
27         '../third_party/modp_b64/modp_b64.gyp:modp_b64',
28         'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
29       ],
30       # TODO(gregoryd): direct_dependent_settings should be shared with the
31       #  64-bit target, but it doesn't work due to a bug in gyp
32       'direct_dependent_settings': {
33         'include_dirs': [
34           '..',
35         ],
36       },
37       'conditions': [
38         ['desktop_linux == 1 or chromeos == 1', {
39           'conditions': [
40             ['chromeos==1', {
41               'sources/': [ ['include', '_chromeos\\.cc$'] ]
42             }],
43           ],
44           'dependencies': [
45             'symbolize',
46             'xdg_mime',
47           ],
48           'defines': [
49             'USE_SYMBOLIZE',
50           ],
51         }, {  # desktop_linux == 0 and chromeos == 0
52             'sources/': [
53               ['exclude', '/xdg_user_dirs/'],
54               ['exclude', '_nss\\.cc$'],
55             ],
56         }],
57         ['use_glib==1', {
58           'dependencies': [
59             '../build/linux/system.gyp:glib',
60           ],
61           'export_dependent_settings': [
62             '../build/linux/system.gyp:glib',
63           ],
64         }],
65         ['OS == "android" and _toolset == "host"', {
66           # Always build base as a static_library for host toolset, even if
67           # we're doing a component build. Specifically, we only care about the
68           # target toolset using components since that's what developers are
69           # focusing on. In theory we should do this more generally for all
70           # targets when building for host, but getting the gyp magic
71           # per-toolset for the "component" variable is hard, and we really only
72           # need base on host.
73           'type': 'static_library',
74           # Base for host support is the minimum required to run the
75           # ssl false start blacklist tool. It requires further changes
76           # to generically support host builds (and tests).
77           # Note: when building for host, gyp has OS == "android",
78           # hence the *_android.cc files are included but the actual code
79           # doesn't have OS_ANDROID / ANDROID defined.
80           'conditions': [
81             ['host_os == "mac"', {
82               'sources/': [
83                 ['exclude', '^native_library_linux\\.cc$'],
84                 ['exclude', '^process_util_linux\\.cc$'],
85                 ['exclude', '^sys_info_linux\\.cc$'],
86                 ['exclude', '^sys_string_conversions_linux\\.cc$'],
87                 ['exclude', '^worker_pool_linux\\.cc$'],
88               ],
89             }],
90           ],
91         }],
92         ['OS == "android" and _toolset == "target"', {
93           'dependencies': [
94             'base_java',
95             'base_jni_headers',
96             '../build/android/ndk.gyp:cpu_features',
97             '../third_party/ashmem/ashmem.gyp:ashmem',
98           ],
99           'link_settings': {
100             'libraries': [
101               '-llog',
102             ],
103           },
104           'sources!': [
105             'debug/stack_trace_posix.cc',
106           ],
107         }],
108         ['os_bsd==1', {
109           'include_dirs': [
110             '/usr/local/include',
111           ],
112           'link_settings': {
113             'libraries': [
114               '-L/usr/local/lib -lexecinfo',
115             ],
116           },
117         }],
118         ['OS == "linux"', {
119           'link_settings': {
120             'libraries': [
121               # We need rt for clock_gettime().
122               '-lrt',
123               # For 'native_library_linux.cc'
124               '-ldl',
125             ],
126           },
127           'conditions': [
128             ['use_allocator!="tcmalloc"', {
129               'defines': [
130                 'NO_TCMALLOC',
131               ],
132               'direct_dependent_settings': {
133                 'defines': [
134                   'NO_TCMALLOC',
135                 ],
136               },
137             }],
138           ],
139         }],
140         ['OS == "win"', {
141           # Specify delayload for base.dll.
142           'msvs_settings': {
143             'VCLinkerTool': {
144               'DelayLoadDLLs': [
145                 'cfgmgr32.dll',
146                 'powrprof.dll',
147                 'setupapi.dll',
148               ],
149               'AdditionalDependencies': [
150                 'cfgmgr32.lib',
151                 'powrprof.lib',
152                 'setupapi.lib',
153               ],
154             },
155           },
156           # Specify delayload for components that link with base.lib.
157           'all_dependent_settings': {
158             'msvs_settings': {
159               'VCLinkerTool': {
160                 'DelayLoadDLLs': [
161                   'cfgmgr32.dll',
162                   'powrprof.dll',
163                   'setupapi.dll',
164                 ],
165                 'AdditionalDependencies': [
166                   'cfgmgr32.lib',
167                   'powrprof.lib',
168                   'setupapi.lib',
169                 ],
170               },
171             },
172           },
173           'copies': [
174             {
175               'destination': '<(PRODUCT_DIR)/',
176               'files': [
177                 '../build/win/dbghelp_xp/dbghelp.dll',
178               ],
179             },
180           ],
181           'dependencies': [
182            'trace_event/etw_manifest/etw_manifest.gyp:etw_manifest',
183           ],
184         }],
185         ['OS == "mac" or (OS == "ios" and _toolset == "host")', {
186           'link_settings': {
187             'libraries': [
188               '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
189               '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework',
190               '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
191               '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
192               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
193               '$(SDKROOT)/System/Library/Frameworks/IOKit.framework',
194               '$(SDKROOT)/System/Library/Frameworks/Security.framework',
195             ],
196           },
197         }],
198         ['OS == "ios" and _toolset != "host"', {
199           'link_settings': {
200             'libraries': [
201               '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
202               '$(SDKROOT)/System/Library/Frameworks/CoreGraphics.framework',
203               '$(SDKROOT)/System/Library/Frameworks/CoreText.framework',
204               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
205               '$(SDKROOT)/System/Library/Frameworks/UIKit.framework',
206             ],
207           },
208         }],
209         ['OS != "win" and (OS != "ios" or _toolset == "host")', {
210             'dependencies': ['../third_party/libevent/libevent.gyp:libevent'],
211         },],
212         ['component=="shared_library"', {
213           'conditions': [
214             ['OS=="win"', {
215               'sources!': [
216                 'debug/debug_on_start_win.cc',
217               ],
218             }],
219           ],
220         }],
221       ],
222       'sources': [
223         'async_socket_io_handler.h',
224         'async_socket_io_handler_posix.cc',
225         'async_socket_io_handler_win.cc',
226         'auto_reset.h',
227         'linux_util.cc',
228         'linux_util.h',
229         'message_loop/message_pump_android.cc',
230         'message_loop/message_pump_android.h',
231         'message_loop/message_pump_glib.cc',
232         'message_loop/message_pump_glib.h',
233         'message_loop/message_pump_io_ios.cc',
234         'message_loop/message_pump_io_ios.h',
235         'message_loop/message_pump_libevent.cc',
236         'message_loop/message_pump_libevent.h',
237         'message_loop/message_pump_mac.h',
238         'message_loop/message_pump_mac.mm',
239         'metrics/field_trial.cc',
240         'metrics/field_trial.h',
241         'posix/file_descriptor_shuffle.cc',
242         'posix/file_descriptor_shuffle.h',
243         'sync_socket.h',
244         'sync_socket_posix.cc',
245         'sync_socket_win.cc',
246         'third_party/xdg_user_dirs/xdg_user_dir_lookup.cc',
247         'third_party/xdg_user_dirs/xdg_user_dir_lookup.h',
248       ],
249       'includes': [
250         '../build/android/increase_size_for_speed.gypi',
251       ],
252     },
253     {
254       'target_name': 'base_i18n',
255       'type': '<(component)',
256       'variables': {
257         'enable_wexit_time_destructors': 1,
258         'optimize': 'max',
259         'base_i18n_target': 1,
260       },
261       'dependencies': [
262         'base',
263         'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
264         '../third_party/icu/icu.gyp:icui18n',
265         '../third_party/icu/icu.gyp:icuuc',
266       ],
267       'conditions': [
268         ['OS == "win"', {
269           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
270           'msvs_disabled_warnings': [
271             4267,
272           ],
273         }],
274         ['icu_use_data_file_flag==1', {
275           'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'],
276         }, { # else icu_use_data_file_flag !=1
277           'conditions': [
278             ['OS=="win"', {
279               'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED'],
280             }, {
281               'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC'],
282             }],
283           ],
284         }],
285         ['OS == "ios"', {
286           'toolsets': ['host', 'target'],
287         }],
288       ],
289       'export_dependent_settings': [
290         'base',
291         '../third_party/icu/icu.gyp:icuuc',
292         '../third_party/icu/icu.gyp:icui18n',
293       ],
294       'includes': [
295         '../build/android/increase_size_for_speed.gypi',
296       ],
297     },
298     {
299       'target_name': 'base_message_loop_tests',
300       'type': 'static_library',
301       'dependencies': [
302         'base',
303         '../testing/gtest.gyp:gtest',
304       ],
305       'sources': [
306         'message_loop/message_loop_test.cc',
307         'message_loop/message_loop_test.h',
308       ],
309     },
310     {
311       'target_name': 'base_prefs',
312       'type': '<(component)',
313       'variables': {
314         'enable_wexit_time_destructors': 1,
315         'optimize': 'max',
316       },
317       'dependencies': [
318         'base',
319       ],
320       'export_dependent_settings': [
321         'base',
322       ],
323       'defines': [
324         'BASE_PREFS_IMPLEMENTATION',
325       ],
326       'sources': [
327         'prefs/base_prefs_export.h',
328         'prefs/default_pref_store.cc',
329         'prefs/default_pref_store.h',
330         'prefs/json_pref_store.cc',
331         'prefs/json_pref_store.h',
332         'prefs/overlay_user_pref_store.cc',
333         'prefs/overlay_user_pref_store.h',
334         'prefs/persistent_pref_store.h',
335         'prefs/pref_change_registrar.cc',
336         'prefs/pref_change_registrar.h',
337         'prefs/pref_filter.h',
338         'prefs/pref_member.cc',
339         'prefs/pref_member.h',
340         'prefs/pref_notifier.h',
341         'prefs/pref_notifier_impl.cc',
342         'prefs/pref_notifier_impl.h',
343         'prefs/pref_observer.h',
344         'prefs/pref_registry.cc',
345         'prefs/pref_registry.h',
346         'prefs/pref_registry_simple.cc',
347         'prefs/pref_registry_simple.h',
348         'prefs/pref_service.cc',
349         'prefs/pref_service.h',
350         'prefs/pref_service_factory.cc',
351         'prefs/pref_service_factory.h',
352         'prefs/pref_store.cc',
353         'prefs/pref_store.h',
354         'prefs/pref_value_map.cc',
355         'prefs/pref_value_map.h',
356         'prefs/pref_value_store.cc',
357         'prefs/pref_value_store.h',
358         'prefs/scoped_user_pref_update.cc',
359         'prefs/scoped_user_pref_update.h',
360         'prefs/value_map_pref_store.cc',
361         'prefs/value_map_pref_store.h',
362         'prefs/writeable_pref_store.h',
363       ],
364       'includes': [
365         '../build/android/increase_size_for_speed.gypi',
366       ],
367     },
368     {
369       'target_name': 'base_prefs_test_support',
370       'type': 'static_library',
371       'dependencies': [
372         'base',
373         'base_prefs',
374         '../testing/gmock.gyp:gmock',
375       ],
376       'sources': [
377         'prefs/mock_pref_change_callback.cc',
378         'prefs/pref_store_observer_mock.cc',
379         'prefs/pref_store_observer_mock.h',
380         'prefs/testing_pref_service.cc',
381         'prefs/testing_pref_service.h',
382         'prefs/testing_pref_store.cc',
383         'prefs/testing_pref_store.h',
384       ],
385     },
386     {
387       # This is the subset of files from base that should not be used with a
388       # dynamic library. Note that this library cannot depend on base because
389       # base depends on base_static.
390       'target_name': 'base_static',
391       'type': 'static_library',
392       'variables': {
393         'enable_wexit_time_destructors': 1,
394         'optimize': 'max',
395       },
396       'toolsets': ['host', 'target'],
397       'sources': [
398         'base_switches.cc',
399         'base_switches.h',
400         'win/pe_image.cc',
401         'win/pe_image.h',
402       ],
403       'include_dirs': [
404         '..',
405       ],
406       'includes': [
407         '../build/android/increase_size_for_speed.gypi',
408       ],
409     },
410     # Include this target for a main() function that simply instantiates
411     # and runs a base::TestSuite.
412     {
413       'target_name': 'run_all_unittests',
414       'type': 'static_library',
415       'dependencies': [
416         'test_support_base',
417       ],
418       'sources': [
419         'test/run_all_unittests.cc',
420       ],
421     },
422     {
423       'target_name': 'base_unittests',
424       'type': '<(gtest_target_type)',
425       'sources': [
426         'android/application_status_listener_unittest.cc',
427         'android/content_uri_utils_unittest.cc',
428         'android/jni_android_unittest.cc',
429         'android/jni_array_unittest.cc',
430         'android/jni_string_unittest.cc',
431         'android/library_loader/library_prefetcher_unittest.cc',
432         'android/path_utils_unittest.cc',
433         'android/scoped_java_ref_unittest.cc',
434         'android/sys_utils_unittest.cc',
435         'async_socket_io_handler_unittest.cc',
436         'at_exit_unittest.cc',
437         'atomicops_unittest.cc',
438         'barrier_closure_unittest.cc',
439         'base64_unittest.cc',
440         'big_endian_unittest.cc',
441         'bind_unittest.cc',
442         'bind_unittest.nc',
443         'bits_unittest.cc',
444         'build_time_unittest.cc',
445         'callback_helpers_unittest.cc',
446         'callback_list_unittest.cc',
447         'callback_list_unittest.nc',
448         'callback_unittest.cc',
449         'callback_unittest.nc',
450         'cancelable_callback_unittest.cc',
451         'command_line_unittest.cc',
452         'containers/adapters_unittest.cc',
453         'containers/hash_tables_unittest.cc',
454         'containers/linked_list_unittest.cc',
455         'containers/mru_cache_unittest.cc',
456         'containers/scoped_ptr_hash_map_unittest.cc',
457         'containers/scoped_ptr_map_unittest.cc',
458         'containers/small_map_unittest.cc',
459         'containers/stack_container_unittest.cc',
460         'cpu_unittest.cc',
461         'debug/crash_logging_unittest.cc',
462         'debug/debugger_unittest.cc',
463         'debug/leak_tracker_unittest.cc',
464         'debug/proc_maps_linux_unittest.cc',
465         'debug/stack_trace_unittest.cc',
466         'debug/task_annotator_unittest.cc',
467         'deferred_sequenced_task_runner_unittest.cc',
468         'environment_unittest.cc',
469         'feature_list_unittest.cc',
470         'file_version_info_unittest.cc',
471         'files/dir_reader_posix_unittest.cc',
472         'files/file_path_unittest.cc',
473         'files/file_path_watcher_unittest.cc',
474         'files/file_proxy_unittest.cc',
475         'files/file_unittest.cc',
476         'files/file_util_proxy_unittest.cc',
477         'files/file_util_unittest.cc',
478         'files/important_file_writer_unittest.cc',
479         'files/memory_mapped_file_unittest.cc',
480         'files/scoped_temp_dir_unittest.cc',
481         'gmock_unittest.cc',
482         'guid_unittest.cc',
483         'hash_unittest.cc',
484         'i18n/break_iterator_unittest.cc',
485         'i18n/case_conversion_unittest.cc',
486         'i18n/char_iterator_unittest.cc',
487         'i18n/file_util_icu_unittest.cc',
488         'i18n/icu_string_conversions_unittest.cc',
489         'i18n/message_formatter_unittest.cc',
490         'i18n/number_formatting_unittest.cc',
491         'i18n/rtl_unittest.cc',
492         'i18n/streaming_utf8_validator_unittest.cc',
493         'i18n/string_search_unittest.cc',
494         'i18n/time_formatting_unittest.cc',
495         'i18n/timezone_unittest.cc',
496         'id_map_unittest.cc',
497         'ios/crb_protocol_observers_unittest.mm',
498         'ios/device_util_unittest.mm',
499         'ios/weak_nsobject_unittest.mm',
500         'json/json_parser_unittest.cc',
501         'json/json_reader_unittest.cc',
502         'json/json_value_converter_unittest.cc',
503         'json/json_value_serializer_unittest.cc',
504         'json/json_writer_unittest.cc',
505         'json/string_escape_unittest.cc',
506         'lazy_instance_unittest.cc',
507         'logging_unittest.cc',
508         'mac/bind_objc_block_unittest.mm',
509         'mac/call_with_eh_frame_unittest.mm',
510         'mac/dispatch_source_mach_unittest.cc',
511         'mac/foundation_util_unittest.mm',
512         'mac/libdispatch_task_runner_unittest.cc',
513         'mac/mac_util_unittest.mm',
514         'mac/objc_property_releaser_unittest.mm',
515         'mac/scoped_nsobject_unittest.mm',
516         'mac/scoped_objc_class_swizzler_unittest.mm',
517         'mac/scoped_sending_event_unittest.mm',
518         'md5_unittest.cc',
519         'memory/aligned_memory_unittest.cc',
520         'memory/discardable_shared_memory_unittest.cc',
521         'memory/linked_ptr_unittest.cc',
522         'memory/memory_pressure_listener_unittest.cc',
523         'memory/memory_pressure_monitor_chromeos_unittest.cc',
524         'memory/memory_pressure_monitor_mac_unittest.cc',
525         'memory/memory_pressure_monitor_win_unittest.cc',
526         'memory/ref_counted_memory_unittest.cc',
527         'memory/ref_counted_unittest.cc',
528         'memory/scoped_ptr_unittest.cc',
529         'memory/scoped_ptr_unittest.nc',
530         'memory/scoped_vector_unittest.cc',
531         'memory/shared_memory_unittest.cc',
532         'memory/singleton_unittest.cc',
533         'memory/weak_ptr_unittest.cc',
534         'memory/weak_ptr_unittest.nc',
535         'message_loop/message_loop_task_runner_unittest.cc',
536         'message_loop/message_loop_unittest.cc',
537         'message_loop/message_pump_glib_unittest.cc',
538         'message_loop/message_pump_io_ios_unittest.cc',
539         'message_loop/message_pump_libevent_unittest.cc',
540         'metrics/bucket_ranges_unittest.cc',
541         'metrics/field_trial_unittest.cc',
542         'metrics/histogram_base_unittest.cc',
543         'metrics/histogram_delta_serialization_unittest.cc',
544         'metrics/histogram_macros_unittest.cc',
545         'metrics/histogram_snapshot_manager_unittest.cc',
546         'metrics/histogram_unittest.cc',
547         'metrics/sample_map_unittest.cc',
548         'metrics/sample_vector_unittest.cc',
549         'metrics/sparse_histogram_unittest.cc',
550         'metrics/statistics_recorder_unittest.cc',
551         'move_unittest.cc',
552         'numerics/safe_numerics_unittest.cc',
553         'observer_list_unittest.cc',
554         'os_compat_android_unittest.cc',
555         'path_service_unittest.cc',
556         'pickle_unittest.cc',
557         'posix/file_descriptor_shuffle_unittest.cc',
558         'posix/unix_domain_socket_linux_unittest.cc',
559         'power_monitor/power_monitor_unittest.cc',
560         'prefs/default_pref_store_unittest.cc',
561         'prefs/json_pref_store_unittest.cc',
562         'prefs/mock_pref_change_callback.h',
563         'prefs/overlay_user_pref_store_unittest.cc',
564         'prefs/pref_change_registrar_unittest.cc',
565         'prefs/pref_member_unittest.cc',
566         'prefs/pref_notifier_impl_unittest.cc',
567         'prefs/pref_service_unittest.cc',
568         'prefs/pref_value_map_unittest.cc',
569         'prefs/pref_value_store_unittest.cc',
570         'prefs/scoped_user_pref_update_unittest.cc',
571         'process/memory_unittest.cc',
572         'process/memory_unittest_mac.h',
573         'process/memory_unittest_mac.mm',
574         'process/process_metrics_unittest.cc',
575         'process/process_metrics_unittest_ios.cc',
576         'process/process_unittest.cc',
577         'process/process_util_unittest.cc',
578         'profiler/stack_sampling_profiler_unittest.cc',
579         'profiler/tracked_time_unittest.cc',
580         'rand_util_unittest.cc',
581         'scoped_clear_errno_unittest.cc',
582         'scoped_generic_unittest.cc',
583         'scoped_native_library_unittest.cc',
584         'security_unittest.cc',
585         'sequence_checker_unittest.cc',
586         'sha1_unittest.cc',
587         'stl_util_unittest.cc',
588         'strings/nullable_string16_unittest.cc',
589         'strings/pattern_unittest.cc',
590         'strings/safe_sprintf_unittest.cc',
591         'strings/string16_unittest.cc',
592         'strings/string_number_conversions_unittest.cc',
593         'strings/string_piece_unittest.cc',
594         'strings/string_split_unittest.cc',
595         'strings/string_tokenizer_unittest.cc',
596         'strings/string_util_unittest.cc',
597         'strings/stringize_macros_unittest.cc',
598         'strings/stringprintf_unittest.cc',
599         'strings/sys_string_conversions_mac_unittest.mm',
600         'strings/sys_string_conversions_unittest.cc',
601         'strings/utf_offset_string_conversions_unittest.cc',
602         'strings/utf_string_conversions_unittest.cc',
603         'supports_user_data_unittest.cc',
604         'sync_socket_unittest.cc',
605         'synchronization/cancellation_flag_unittest.cc',
606         'synchronization/condition_variable_unittest.cc',
607         'synchronization/lock_unittest.cc',
608         'synchronization/waitable_event_unittest.cc',
609         'synchronization/waitable_event_watcher_unittest.cc',
610         'sys_info_unittest.cc',
611         'system_monitor/system_monitor_unittest.cc',
612         'task/cancelable_task_tracker_unittest.cc',
613         'task_runner_util_unittest.cc',
614         'template_util_unittest.cc',
615         'test/histogram_tester_unittest.cc',
616         'test/test_pending_task_unittest.cc',
617         'test/test_reg_util_win_unittest.cc',
618         'test/trace_event_analyzer_unittest.cc',
619         'test/user_action_tester_unittest.cc',
620         'threading/non_thread_safe_unittest.cc',
621         'threading/platform_thread_unittest.cc',
622         'threading/sequenced_worker_pool_unittest.cc',
623         'threading/simple_thread_unittest.cc',
624         'threading/thread_checker_unittest.cc',
625         'threading/thread_collision_warner_unittest.cc',
626         'threading/thread_id_name_manager_unittest.cc',
627         'threading/thread_local_storage_unittest.cc',
628         'threading/thread_local_unittest.cc',
629         'threading/thread_unittest.cc',
630         'threading/watchdog_unittest.cc',
631         'threading/worker_pool_posix_unittest.cc',
632         'threading/worker_pool_unittest.cc',
633         'time/pr_time_unittest.cc',
634         'time/time_unittest.cc',
635         'time/time_win_unittest.cc',
636         'timer/hi_res_timer_manager_unittest.cc',
637         'timer/mock_timer_unittest.cc',
638         'timer/timer_unittest.cc',
639         'tools_sanity_unittest.cc',
640         'tracked_objects_unittest.cc',
641         'tuple_unittest.cc',
642         'values_unittest.cc',
643         'version_unittest.cc',
644         'vlog_unittest.cc',
645         'win/dllmain.cc',
646         'win/enum_variant_unittest.cc',
647         'win/event_trace_consumer_unittest.cc',
648         'win/event_trace_controller_unittest.cc',
649         'win/event_trace_provider_unittest.cc',
650         'win/i18n_unittest.cc',
651         'win/iunknown_impl_unittest.cc',
652         'win/message_window_unittest.cc',
653         'win/object_watcher_unittest.cc',
654         'win/pe_image_unittest.cc',
655         'win/registry_unittest.cc',
656         'win/scoped_bstr_unittest.cc',
657         'win/scoped_comptr_unittest.cc',
658         'win/scoped_handle_unittest.cc',
659         'win/scoped_process_information_unittest.cc',
660         'win/scoped_variant_unittest.cc',
661         'win/shortcut_unittest.cc',
662         'win/startup_information_unittest.cc',
663         'win/win_util_unittest.cc',
664         'win/wrapped_window_proc_unittest.cc',
665         '<@(trace_event_test_sources)',
666       ],
667       'dependencies': [
668         'base',
669         'base_i18n',
670         'base_message_loop_tests',
671         'base_prefs',
672         'base_prefs_test_support',
673         'base_static',
674         'run_all_unittests',
675         'test_support_base',
676         'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
677         '../testing/gmock.gyp:gmock',
678         '../testing/gtest.gyp:gtest',
679         '../third_party/icu/icu.gyp:icui18n',
680         '../third_party/icu/icu.gyp:icuuc',
681       ],
682       'includes': ['../build/nocompile.gypi'],
683       'variables': {
684          # TODO(ajwong): Is there a way to autodetect this?
685         'module_dir': 'base'
686       },
687       'conditions': [
688         ['OS == "android"', {
689           'dependencies': [
690             'android/jni_generator/jni_generator.gyp:jni_generator_tests',
691             '../testing/android/native_test.gyp:native_test_native_code',
692           ],
693         }],
694         ['OS == "ios" and _toolset != "host"', {
695           'sources/': [
696             # iOS does not support FilePathWatcher.
697             ['exclude', '^files/file_path_watcher_unittest\\.cc$'],
698             # Only test the iOS-meaningful portion of memory and process_utils.
699             ['exclude', '^memory/discardable_shared_memory_unittest\\.cc$'],
700             ['exclude', '^memory/shared_memory_unittest\\.cc$'],
701             ['exclude', '^process/memory_unittest'],
702             ['exclude', '^process/process_unittest\\.cc$'],
703             ['exclude', '^process/process_util_unittest\\.cc$'],
704             ['include', '^process/process_util_unittest_ios\\.cc$'],
705             # iOS does not use message_pump_libevent.
706             ['exclude', '^message_loop/message_pump_libevent_unittest\\.cc$'],
707           ],
708           'actions': [
709             {
710               'action_name': 'copy_test_data',
711               'variables': {
712                 'test_data_files': [
713                   'test/data',
714                 ],
715                 'test_data_prefix': 'base',
716               },
717               'includes': [ '../build/copy_test_data_ios.gypi' ],
718             },
719           ],
720         }],
721         ['desktop_linux == 1 or chromeos == 1', {
722           'defines': [
723             'USE_SYMBOLIZE',
724           ],
725           'sources!': [
726             'file_version_info_unittest.cc',
727           ],
728           'conditions': [
729             [ 'desktop_linux==1', {
730               'sources': [
731                 'nix/xdg_util_unittest.cc',
732               ],
733             }],
734           ],
735         }],
736         ['use_glib == 1', {
737           'dependencies': [
738             '../build/linux/system.gyp:glib',
739           ],
740         }, {  # use_glib == 0
741           'sources!': [
742             'message_loop/message_pump_glib_unittest.cc',
743           ]
744         }],
745         ['use_ozone == 1', {
746           'sources!': [
747             'message_loop/message_pump_glib_unittest.cc',
748           ]
749         }],
750         ['OS == "linux"', {
751           'dependencies': [
752             'malloc_wrapper',
753           ],
754           'conditions': [
755             ['use_allocator!="none"', {
756               'dependencies': [
757                 'allocator/allocator.gyp:allocator',
758               ],
759             }],
760           ]},
761         ],
762         [ 'OS == "win" and target_arch == "x64"', {
763           'sources': [
764             'profiler/win32_stack_frame_unwinder_unittest.cc',
765           ],
766         }],
767         ['OS == "win"', {
768           'sources!': [
769             'file_descriptor_shuffle_unittest.cc',
770             'files/dir_reader_posix_unittest.cc',
771             'message_loop/message_pump_libevent_unittest.cc',
772             'threading/worker_pool_posix_unittest.cc',
773           ],
774           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
775           'msvs_disabled_warnings': [
776             4267,
777           ],
778           'conditions': [
779             # This is needed so base_unittests uses the allocator shim, as
780             # SecurityTest.MemoryAllocationRestriction* tests are dependent
781             # on tcmalloc.
782             # TODO(wfh): crbug.com/246278 Move tcmalloc specific tests into
783             # their own test suite.
784             ['win_use_allocator_shim==1', {
785               'dependencies': [
786                 'allocator/allocator.gyp:allocator',
787               ],
788             }],
789             ['icu_use_data_file_flag==0', {
790               # This is needed to trigger the dll copy step on windows.
791               # TODO(mark): This should not be necessary.
792               'dependencies': [
793                 '../third_party/icu/icu.gyp:icudata',
794               ],
795             }],
796           ],
797         }, {  # OS != "win"
798           'dependencies': [
799             '../third_party/libevent/libevent.gyp:libevent'
800           ],
801         }],
802       ],  # conditions
803       'target_conditions': [
804         ['OS == "ios" and _toolset != "host"', {
805           'sources/': [
806             # Pull in specific Mac files for iOS (which have been filtered out
807             # by file name rules).
808             ['include', '^mac/bind_objc_block_unittest\\.mm$'],
809             ['include', '^mac/foundation_util_unittest\\.mm$',],
810             ['include', '^mac/objc_property_releaser_unittest\\.mm$'],
811             ['include', '^mac/scoped_nsobject_unittest\\.mm$'],
812             ['include', '^sys_string_conversions_mac_unittest\\.mm$'],
813           ],
814         }],
815         ['OS == "android"', {
816           'sources/': [
817             ['include', '^debug/proc_maps_linux_unittest\\.cc$'],
818           ],
819         }],
820         # Enable more direct string conversions on platforms with native utf8
821         # strings
822         ['OS=="mac" or OS=="ios" or <(chromeos)==1 or <(chromecast)==1', {
823           'defines': ['SYSTEM_NATIVE_UTF8'],
824         }],
825       ],  # target_conditions
826     },
827     {
828       # GN: //base:base_perftests
829       'target_name': 'base_perftests',
830       'type': '<(gtest_target_type)',
831       'dependencies': [
832         'base',
833         'test_support_base',
834         '../testing/gtest.gyp:gtest',
835       ],
836       'sources': [
837         'message_loop/message_pump_perftest.cc',
838         'test/run_all_unittests.cc',
839         'threading/thread_perftest.cc',
840         '../testing/perf/perf_test.cc'
841       ],
842       'conditions': [
843         ['OS == "android"', {
844           'dependencies': [
845             '../testing/android/native_test.gyp:native_test_native_code',
846           ],
847         }],
848       ],
849     },
850     {
851       # GN: //base:base_i18n_perftests
852       'target_name': 'base_i18n_perftests',
853       'type': '<(gtest_target_type)',
854       'dependencies': [
855         'test_support_base',
856         'test_support_perf',
857         '../testing/gtest.gyp:gtest',
858         'base_i18n',
859         'base',
860       ],
861       'sources': [
862         'i18n/streaming_utf8_validator_perftest.cc',
863       ],
864     },
865     {
866       # GN: //base/test:test_support
867       'target_name': 'test_support_base',
868       'type': 'static_library',
869       'dependencies': [
870         'base',
871         'base_static',
872         'base_i18n',
873         '../testing/gmock.gyp:gmock',
874         '../testing/gtest.gyp:gtest',
875         '../third_party/icu/icu.gyp:icuuc',
876         '../third_party/libxml/libxml.gyp:libxml',
877         'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
878       ],
879       'export_dependent_settings': [
880         'base',
881       ],
882       'conditions': [
883         ['os_posix==0', {
884           'sources!': [
885             'test/scoped_locale.cc',
886             'test/scoped_locale.h',
887           ],
888         }],
889         ['os_bsd==1', {
890           'sources!': [
891             'test/test_file_util_linux.cc',
892           ],
893         }],
894         ['OS == "android"', {
895           'dependencies': [
896             'base_unittests_jni_headers',
897             'base_java_unittest_support',
898           ],
899         }],
900         ['OS == "ios"', {
901           'toolsets': ['host', 'target'],
902         }],
903       ],
904       'sources': [
905         'test/gtest_util.cc',
906         'test/gtest_util.h',
907         'test/gtest_xml_unittest_result_printer.cc',
908         'test/gtest_xml_unittest_result_printer.h',
909         'test/gtest_xml_util.cc',
910         'test/gtest_xml_util.h',
911         'test/histogram_tester.cc',
912         'test/histogram_tester.h',
913         'test/icu_test_util.cc',
914         'test/icu_test_util.h',
915         'test/ios/wait_util.h',
916         'test/ios/wait_util.mm',
917         'test/launcher/test_launcher.cc',
918         'test/launcher/test_launcher.h',
919         'test/launcher/test_result.cc',
920         'test/launcher/test_result.h',
921         'test/launcher/test_results_tracker.cc',
922         'test/launcher/test_results_tracker.h',
923         'test/launcher/unit_test_launcher.cc',
924         'test/launcher/unit_test_launcher.h',
925         'test/launcher/unit_test_launcher_ios.cc',
926         'test/mock_chrome_application_mac.h',
927         'test/mock_chrome_application_mac.mm',
928         'test/mock_devices_changed_observer.cc',
929         'test/mock_devices_changed_observer.h',
930         'test/mock_entropy_provider.cc',
931         'test/mock_entropy_provider.h',
932         'test/mock_log.cc',
933         'test/mock_log.h',
934         'test/multiprocess_test.cc',
935         'test/multiprocess_test.h',
936         'test/multiprocess_test_android.cc',
937         'test/null_task_runner.cc',
938         'test/null_task_runner.h',
939         'test/opaque_ref_counted.cc',
940         'test/opaque_ref_counted.h',
941         'test/perf_log.cc',
942         'test/perf_log.h',
943         'test/perf_test_suite.cc',
944         'test/perf_test_suite.h',
945         'test/perf_time_logger.cc',
946         'test/perf_time_logger.h',
947         'test/power_monitor_test_base.cc',
948         'test/power_monitor_test_base.h',
949         'test/scoped_locale.cc',
950         'test/scoped_locale.h',
951         'test/scoped_path_override.cc',
952         'test/scoped_path_override.h',
953         'test/sequenced_task_runner_test_template.cc',
954         'test/sequenced_task_runner_test_template.h',
955         'test/sequenced_worker_pool_owner.cc',
956         'test/sequenced_worker_pool_owner.h',
957         'test/simple_test_clock.cc',
958         'test/simple_test_clock.h',
959         'test/simple_test_tick_clock.cc',
960         'test/simple_test_tick_clock.h',
961         'test/task_runner_test_template.cc',
962         'test/task_runner_test_template.h',
963         'test/test_discardable_memory_allocator.cc',
964         'test/test_discardable_memory_allocator.h',
965         'test/test_file_util.cc',
966         'test/test_file_util.h',
967         'test/test_file_util_android.cc',
968         'test/test_file_util_linux.cc',
969         'test/test_file_util_mac.cc',
970         'test/test_file_util_posix.cc',
971         'test/test_file_util_win.cc',
972         'test/test_io_thread.cc',
973         'test/test_io_thread.h',
974         'test/test_listener_ios.h',
975         'test/test_listener_ios.mm',
976         'test/test_mock_time_task_runner.cc',
977         'test/test_mock_time_task_runner.h',
978         'test/test_pending_task.cc',
979         'test/test_pending_task.h',
980         'test/test_reg_util_win.cc',
981         'test/test_reg_util_win.h',
982         'test/test_shortcut_win.cc',
983         'test/test_shortcut_win.h',
984         'test/test_simple_task_runner.cc',
985         'test/test_simple_task_runner.h',
986         'test/test_suite.cc',
987         'test/test_suite.h',
988         'test/test_support_android.cc',
989         'test/test_support_android.h',
990         'test/test_support_ios.h',
991         'test/test_support_ios.mm',
992         'test/test_switches.cc',
993         'test/test_switches.h',
994         'test/test_timeouts.cc',
995         'test/test_timeouts.h',
996         'test/test_ui_thread_android.cc',
997         'test/test_ui_thread_android.h',
998         'test/thread_test_helper.cc',
999         'test/thread_test_helper.h',
1000         'test/trace_event_analyzer.cc',
1001         'test/trace_event_analyzer.h',
1002         'test/trace_to_file.cc',
1003         'test/trace_to_file.h',
1004         'test/user_action_tester.cc',
1005         'test/user_action_tester.h',
1006         'test/values_test_util.cc',
1007         'test/values_test_util.h',
1008       ],
1009       'target_conditions': [
1010         ['OS == "ios"', {
1011           'sources/': [
1012             # Pull in specific Mac files for iOS (which have been filtered out
1013             # by file name rules).
1014             ['include', '^test/test_file_util_mac\\.cc$'],
1015           ],
1016         }],
1017         ['OS == "ios" and _toolset == "target"', {
1018           'sources!': [
1019             # iOS uses its own unit test launcher.
1020             'test/launcher/unit_test_launcher.cc',
1021           ],
1022         }],
1023         ['OS == "ios" and _toolset == "host"', {
1024           'sources!': [
1025             'test/launcher/unit_test_launcher_ios.cc',
1026             'test/test_support_ios.h',
1027             'test/test_support_ios.mm',
1028           ],
1029         }],
1030       ],  # target_conditions
1031     },
1032     {
1033       'target_name': 'test_support_perf',
1034       'type': 'static_library',
1035       'dependencies': [
1036         'base',
1037         'test_support_base',
1038         '../testing/gtest.gyp:gtest',
1039       ],
1040       'sources': [
1041         'test/run_all_perftests.cc',
1042       ],
1043       'direct_dependent_settings': {
1044         'defines': [
1045           'PERF_TEST',
1046         ],
1047       },
1048     },
1049     {
1050       'target_name': 'test_launcher_nacl_nonsfi',
1051       'conditions': [
1052         ['disable_nacl==0 and disable_nacl_untrusted==0 and enable_nacl_nonsfi_test==1', {
1053           'type': 'static_library',
1054           'sources': [
1055             'test/launcher/test_launcher_nacl_nonsfi.cc',
1056           ],
1057           'dependencies': [
1058             'test_support_base',
1059           ],
1060         }, {
1061           'type': 'none',
1062         }],
1063       ],
1064     },
1065   ],
1066   'conditions': [
1067     ['OS=="ios" and "<(GENERATOR)"=="ninja"', {
1068       'targets': [
1069         {
1070           'target_name': 'test_launcher',
1071           'toolsets': ['host'],
1072           'type': 'executable',
1073           'dependencies': [
1074             'test_support_base',
1075           ],
1076           'sources': [
1077             'test/launcher/test_launcher_ios.cc',
1078           ],
1079         },
1080       ],
1081     }],
1082     ['OS!="ios"', {
1083       'targets': [
1084         {
1085           # GN: //base:check_example
1086           'target_name': 'check_example',
1087           'type': 'executable',
1088           'sources': [
1089             'check_example.cc',
1090           ],
1091           'dependencies': [
1092             'base',
1093           ],
1094         },
1095         {
1096           'target_name': 'build_utf8_validator_tables',
1097           'type': 'executable',
1098           'toolsets': ['host'],
1099           'dependencies': [
1100             'base',
1101             '../third_party/icu/icu.gyp:icuuc',
1102           ],
1103           'sources': [
1104             'i18n/build_utf8_validator_tables.cc'
1105           ],
1106         },
1107       ],
1108     }],
1109     ['OS == "win" and target_arch=="ia32"', {
1110       'targets': [
1111         # The base_win64 target here allows us to use base for Win64 targets
1112         # (the normal build is 32 bits).
1113         {
1114           'target_name': 'base_win64',
1115           'type': '<(component)',
1116           'variables': {
1117             'base_target': 1,
1118           },
1119           'dependencies': [
1120             'base_static_win64',
1121             'allocator/allocator.gyp:allocator_extension_thunks_win64',
1122             '../third_party/modp_b64/modp_b64.gyp:modp_b64_win64',
1123             'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
1124             'trace_event/etw_manifest/etw_manifest.gyp:etw_manifest',
1125           ],
1126           # TODO(gregoryd): direct_dependent_settings should be shared with the
1127           # 32-bit target, but it doesn't work due to a bug in gyp
1128           'direct_dependent_settings': {
1129             'include_dirs': [
1130               '..',
1131             ],
1132           },
1133           'defines': [
1134             'BASE_WIN64',
1135             '<@(nacl_win64_defines)',
1136           ],
1137           'configurations': {
1138             'Common_Base': {
1139               'msvs_target_platform': 'x64',
1140             },
1141           },
1142           'conditions': [
1143             ['component == "shared_library"', {
1144               'sources!': [
1145                 'debug/debug_on_start_win.cc',
1146               ],
1147             }],
1148           ],
1149           # Specify delayload for base_win64.dll.
1150           'msvs_settings': {
1151             'VCLinkerTool': {
1152               'DelayLoadDLLs': [
1153                 'cfgmgr32.dll',
1154                 'powrprof.dll',
1155                 'setupapi.dll',
1156               ],
1157               'AdditionalDependencies': [
1158                 'cfgmgr32.lib',
1159                 'powrprof.lib',
1160                 'setupapi.lib',
1161               ],
1162             },
1163           },
1164           # Specify delayload for components that link with base_win64.lib.
1165           'all_dependent_settings': {
1166             'msvs_settings': {
1167               'VCLinkerTool': {
1168                 'DelayLoadDLLs': [
1169                   'cfgmgr32.dll',
1170                   'powrprof.dll',
1171                   'setupapi.dll',
1172                 ],
1173                 'AdditionalDependencies': [
1174                   'cfgmgr32.lib',
1175                   'powrprof.lib',
1176                   'setupapi.lib',
1177                 ],
1178               },
1179             },
1180           },
1181           # TODO(rvargas): Bug 78117. Remove this.
1182           'msvs_disabled_warnings': [
1183             4244,
1184             4996,
1185             4267,
1186           ],
1187           'sources': [
1188             'async_socket_io_handler.h',
1189             'async_socket_io_handler_posix.cc',
1190             'async_socket_io_handler_win.cc',
1191             'auto_reset.h',
1192             'linux_util.cc',
1193             'linux_util.h',
1194             'md5.cc',
1195             'md5.h',
1196             'message_loop/message_pump_libevent.cc',
1197             'message_loop/message_pump_libevent.h',
1198             'metrics/field_trial.cc',
1199             'metrics/field_trial.h',
1200             'posix/file_descriptor_shuffle.cc',
1201             'posix/file_descriptor_shuffle.h',
1202             'sync_socket.h',
1203             'sync_socket_posix.cc',
1204             'sync_socket_win.cc',
1205             'third_party/xdg_user_dirs/xdg_user_dir_lookup.cc',
1206             'third_party/xdg_user_dirs/xdg_user_dir_lookup.h',
1207           ],
1208         },
1209         {
1210           'target_name': 'base_i18n_nacl_win64',
1211           'type': '<(component)',
1212           # TODO(gregoryd): direct_dependent_settings should be shared with the
1213           # 32-bit target, but it doesn't work due to a bug in gyp
1214           'direct_dependent_settings': {
1215             'include_dirs': [
1216               '..',
1217             ],
1218           },
1219           'defines': [
1220             '<@(nacl_win64_defines)',
1221             'BASE_I18N_IMPLEMENTATION',
1222           ],
1223           'include_dirs': [
1224             '..',
1225           ],
1226           'sources': [
1227             'i18n/icu_util_nacl_win64.cc',
1228           ],
1229           'configurations': {
1230             'Common_Base': {
1231               'msvs_target_platform': 'x64',
1232             },
1233           },
1234         },
1235         {
1236           # TODO(rvargas): Remove this when gyp finally supports a clean model.
1237           # See bug 36232.
1238           'target_name': 'base_static_win64',
1239           'type': 'static_library',
1240           'sources': [
1241             'base_switches.cc',
1242             'base_switches.h',
1243             'win/pe_image.cc',
1244             'win/pe_image.h',
1245           ],
1246           'sources!': [
1247             # base64.cc depends on modp_b64.
1248             'base64.cc',
1249           ],
1250           'include_dirs': [
1251             '..',
1252           ],
1253           'configurations': {
1254             'Common_Base': {
1255               'msvs_target_platform': 'x64',
1256             },
1257           },
1258           'defines': [
1259             '<@(nacl_win64_defines)',
1260           ],
1261           # TODO(rvargas): Bug 78117. Remove this.
1262           'msvs_disabled_warnings': [
1263             4244,
1264           ],
1265         },
1266       ],
1267     }],
1268     ['os_posix==1 and OS!="mac" and OS!="ios"', {
1269       'targets': [
1270         {
1271           'target_name': 'symbolize',
1272           'type': 'static_library',
1273           'toolsets': ['host', 'target'],
1274           'variables': {
1275             'chromium_code': 0,
1276           },
1277           'conditions': [
1278             ['OS == "solaris"', {
1279               'include_dirs': [
1280                 '/usr/gnu/include',
1281                 '/usr/gnu/include/libelf',
1282               ],
1283             },],
1284           ],
1285           'cflags': [
1286             '-Wno-sign-compare',
1287           ],
1288           'cflags!': [
1289             '-Wextra',
1290           ],
1291           'defines': [
1292             'GLOG_BUILD_CONFIG_INCLUDE="build/build_config.h"',
1293           ],
1294           'sources': [
1295             'third_party/symbolize/config.h',
1296             'third_party/symbolize/demangle.cc',
1297             'third_party/symbolize/demangle.h',
1298             'third_party/symbolize/glog/logging.h',
1299             'third_party/symbolize/glog/raw_logging.h',
1300             'third_party/symbolize/symbolize.cc',
1301             'third_party/symbolize/symbolize.h',
1302             'third_party/symbolize/utilities.h',
1303           ],
1304           'include_dirs': [
1305             '..',
1306           ],
1307           'includes': [
1308             '../build/android/increase_size_for_speed.gypi',
1309           ],
1310         },
1311         {
1312           'target_name': 'xdg_mime',
1313           'type': 'static_library',
1314           'toolsets': ['host', 'target'],
1315           'variables': {
1316             'chromium_code': 0,
1317           },
1318           'cflags!': [
1319             '-Wextra',
1320           ],
1321           'sources': [
1322             'third_party/xdg_mime/xdgmime.c',
1323             'third_party/xdg_mime/xdgmime.h',
1324             'third_party/xdg_mime/xdgmimealias.c',
1325             'third_party/xdg_mime/xdgmimealias.h',
1326             'third_party/xdg_mime/xdgmimecache.c',
1327             'third_party/xdg_mime/xdgmimecache.h',
1328             'third_party/xdg_mime/xdgmimeglob.c',
1329             'third_party/xdg_mime/xdgmimeglob.h',
1330             'third_party/xdg_mime/xdgmimeicon.c',
1331             'third_party/xdg_mime/xdgmimeicon.h',
1332             'third_party/xdg_mime/xdgmimeint.c',
1333             'third_party/xdg_mime/xdgmimeint.h',
1334             'third_party/xdg_mime/xdgmimemagic.c',
1335             'third_party/xdg_mime/xdgmimemagic.h',
1336             'third_party/xdg_mime/xdgmimeparent.c',
1337             'third_party/xdg_mime/xdgmimeparent.h',
1338           ],
1339           'includes': [
1340             '../build/android/increase_size_for_speed.gypi',
1341           ],
1342         },
1343       ],
1344     }],
1345     ['OS == "linux"', {
1346       'targets': [
1347         {
1348           'target_name': 'malloc_wrapper',
1349           'type': 'shared_library',
1350           'dependencies': [
1351             'base',
1352           ],
1353           'sources': [
1354             'test/malloc_wrapper.cc',
1355           ],
1356         }
1357       ],
1358     }],
1359     ['OS == "android"', {
1360       'targets': [
1361         {
1362           # GN: //base:base_jni_headers
1363           'target_name': 'base_jni_headers',
1364           'type': 'none',
1365           'sources': [
1366             'android/java/src/org/chromium/base/ApkAssets.java',
1367             'android/java/src/org/chromium/base/ApplicationStatus.java',
1368             'android/java/src/org/chromium/base/AnimationFrameTimeHistogram.java',
1369             'android/java/src/org/chromium/base/BuildInfo.java',
1370             'android/java/src/org/chromium/base/CommandLine.java',
1371             'android/java/src/org/chromium/base/ContentUriUtils.java',
1372             'android/java/src/org/chromium/base/CpuFeatures.java',
1373             'android/java/src/org/chromium/base/EventLog.java',
1374             'android/java/src/org/chromium/base/FieldTrialList.java',
1375             'android/java/src/org/chromium/base/ImportantFileWriterAndroid.java',
1376             'android/java/src/org/chromium/base/JNIUtils.java',
1377             'android/java/src/org/chromium/base/JavaHandlerThread.java',
1378             'android/java/src/org/chromium/base/LocaleUtils.java',
1379             'android/java/src/org/chromium/base/MemoryPressureListener.java',
1380             'android/java/src/org/chromium/base/PathService.java',
1381             'android/java/src/org/chromium/base/PathUtils.java',
1382             'android/java/src/org/chromium/base/PowerMonitor.java',
1383             'android/java/src/org/chromium/base/SysUtils.java',
1384             'android/java/src/org/chromium/base/SystemMessageHandler.java',
1385             'android/java/src/org/chromium/base/ThreadUtils.java',
1386             'android/java/src/org/chromium/base/TraceEvent.java',
1387             'android/java/src/org/chromium/base/library_loader/LibraryLoader.java',
1388             'android/java/src/org/chromium/base/metrics/RecordHistogram.java',
1389             'android/java/src/org/chromium/base/metrics/RecordUserAction.java',
1390           ],
1391           'variables': {
1392             'jni_gen_package': 'base',
1393           },
1394           'dependencies': [
1395             'android_runtime_jni_headers',
1396           ],
1397           'includes': [ '../build/jni_generator.gypi' ],
1398         },
1399         {
1400           # GN: //base:android_runtime_jni_headers
1401           'target_name': 'android_runtime_jni_headers',
1402           'type': 'none',
1403           'variables': {
1404             'jni_gen_package': 'base',
1405             'input_java_class': 'java/lang/Runtime.class',
1406           },
1407           'includes': [ '../build/jar_file_jni_generator.gypi' ],
1408         },
1409         {
1410           # TODO(GN)
1411           'target_name': 'base_unittests_jni_headers',
1412           'type': 'none',
1413           'sources': [
1414             'test/android/java/src/org/chromium/base/ContentUriTestUtils.java',
1415             'test/android/java/src/org/chromium/base/TestUiThread.java',
1416           ],
1417           'variables': {
1418             'jni_gen_package': 'base',
1419           },
1420           'includes': [ '../build/jni_generator.gypi' ],
1421         },
1422         {
1423           # GN: //base:base_native_libraries_gen
1424           'target_name': 'base_native_libraries_gen',
1425           'type': 'none',
1426           'sources': [
1427             'android/java/templates/NativeLibraries.template',
1428           ],
1429           'variables': {
1430             'package_name': 'org/chromium/base/library_loader',
1431             'template_deps': [],
1432           },
1433           'includes': [ '../build/android/java_cpp_template.gypi' ],
1434         },
1435         {
1436           # GN: //base:base_android_java_enums_srcjar
1437           'target_name': 'base_java_library_process_type',
1438           'type': 'none',
1439           'variables': {
1440             'source_file': 'android/library_loader/library_loader_hooks.h',
1441           },
1442           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1443         },
1444         {
1445           # GN: //base:base_java
1446           'target_name': 'base_java',
1447           'type': 'none',
1448           'variables': {
1449             'java_in_dir': 'android/java',
1450             'jar_excluded_classes': [ '*/NativeLibraries.class' ],
1451           },
1452           'dependencies': [
1453             'base_java_application_state',
1454             'base_java_library_load_from_apk_status_codes',
1455             'base_java_library_process_type',
1456             'base_java_memory_pressure_level',
1457             'base_native_libraries_gen',
1458             '../third_party/android_tools/android_tools.gyp:android_support_multidex_javalib',
1459             '../third_party/jsr-305/jsr-305.gyp:jsr_305_javalib',
1460           ],
1461           'includes': [ '../build/java.gypi' ],
1462         },
1463         {
1464           # GN: //base:base_java_unittest_support
1465           'target_name': 'base_java_unittest_support',
1466           'type': 'none',
1467           'dependencies': [
1468             'base_java',
1469           ],
1470           'variables': {
1471             'java_in_dir': '../base/test/android/java',
1472           },
1473           'includes': [ '../build/java.gypi' ],
1474         },
1475         {
1476           # GN: //base:base_android_java_enums_srcjar
1477           'target_name': 'base_java_application_state',
1478           'type': 'none',
1479           'variables': {
1480             'source_file': 'android/application_status_listener.h',
1481           },
1482           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1483         },
1484         {
1485           # GN: //base:base_android_java_enums_srcjar
1486           'target_name': 'base_java_library_load_from_apk_status_codes',
1487           'type': 'none',
1488           'variables': {
1489             'source_file': 'android/library_loader/library_load_from_apk_status_codes.h'
1490           },
1491           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1492         },
1493         {
1494           # GN: //base:base_android_java_enums_srcjar
1495           'target_name': 'base_java_memory_pressure_level',
1496           'type': 'none',
1497           'variables': {
1498             'source_file': 'memory/memory_pressure_listener.h',
1499           },
1500           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1501         },
1502         {
1503           # GN: //base:base_java_test_support
1504           'target_name': 'base_java_test_support',
1505           'type': 'none',
1506           'dependencies': [
1507             'base_java',
1508             '../testing/android/on_device_instrumentation.gyp:reporter_java',
1509           ],
1510           'variables': {
1511             'java_in_dir': '../base/test/android/javatests',
1512           },
1513           'includes': [ '../build/java.gypi' ],
1514         },
1515         {
1516           # TODO(jbudorick): Remove this once we roll to robolectric 3.0 and pull
1517           # in the multidex shadow library. crbug.com/522043
1518           # GN: //base:base_junit_test_support
1519           'target_name': 'base_junit_test_support',
1520           'type': 'none',
1521           'dependencies': [
1522             '../testing/android/junit/junit_test.gyp:junit_test_support',
1523             '../third_party/android_tools/android_tools.gyp:android_support_multidex_javalib',
1524           ],
1525           'variables': {
1526             'src_paths': [
1527               '../base/test/android/junit/',
1528             ],
1529           },
1530           'includes': [ '../build/host_jar.gypi' ]
1531         },
1532         {
1533           # GN: //base:base_junit_tests
1534           'target_name': 'base_junit_tests',
1535           'type': 'none',
1536           'dependencies': [
1537             'base_java',
1538             'base_java_test_support',
1539             'base_junit_test_support',
1540             '../testing/android/junit/junit_test.gyp:junit_test_support',
1541           ],
1542           'variables': {
1543              'main_class': 'org.chromium.testing.local.JunitTestMain',
1544              'src_paths': [
1545                '../base/android/junit/',
1546              ],
1547            },
1548           'includes': [ '../build/host_jar.gypi' ],
1549         },
1550         {
1551           # GN: //base:base_javatests
1552           'target_name': 'base_javatests',
1553           'type': 'none',
1554           'dependencies': [
1555             'base_java',
1556             'base_java_test_support',
1557           ],
1558           'variables': {
1559             'java_in_dir': '../base/android/javatests',
1560           },
1561           'includes': [ '../build/java.gypi' ],
1562         },
1563         {
1564           # GN: //base/android/linker:chromium_android_linker
1565           'target_name': 'chromium_android_linker',
1566           'type': 'shared_library',
1567           'sources': [
1568             'android/linker/android_dlext.h',
1569             'android/linker/legacy_linker_jni.cc',
1570             'android/linker/legacy_linker_jni.h',
1571             'android/linker/linker_jni.cc',
1572             'android/linker/linker_jni.h',
1573             'android/linker/modern_linker_jni.cc',
1574             'android/linker/modern_linker_jni.h',
1575           ],
1576           # The crazy linker is never instrumented.
1577           'cflags!': [
1578             '-finstrument-functions',
1579           ],
1580           'dependencies': [
1581             # The NDK contains the crazy_linker here:
1582             #   '<(android_ndk_root)/crazy_linker.gyp:crazy_linker'
1583             # However, we use our own fork.  See bug 384700.
1584             '../third_party/android_crazy_linker/crazy_linker.gyp:crazy_linker',
1585           ],
1586         },
1587         {
1588           # TODO(GN)
1589           'target_name': 'base_perftests_apk',
1590           'type': 'none',
1591           'dependencies': [
1592             'base_perftests',
1593           ],
1594           'variables': {
1595             'test_suite_name': 'base_perftests',
1596           },
1597           'includes': [ '../build/apk_test.gypi' ],
1598         },
1599         {
1600           # GN: //base:base_unittests_apk
1601           'target_name': 'base_unittests_apk',
1602           'type': 'none',
1603           'dependencies': [
1604             'base_java',
1605             'base_unittests',
1606           ],
1607           'variables': {
1608             'test_suite_name': 'base_unittests',
1609             'isolate_file': 'base_unittests.isolate',
1610           },
1611           'includes': [ '../build/apk_test.gypi' ],
1612         },
1613       ],
1614     }],
1615     ['OS == "win"', {
1616       'targets': [
1617         {
1618           'target_name': 'debug_message',
1619           'type': 'executable',
1620           'sources': [
1621             'debug_message.cc',
1622           ],
1623           'msvs_settings': {
1624             'VCLinkerTool': {
1625               'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
1626             },
1627           },
1628         },
1629         {
1630           # Target to manually rebuild pe_image_test.dll which is checked into
1631           # base/test/data/pe_image.
1632           'target_name': 'pe_image_test',
1633           'type': 'shared_library',
1634           'sources': [
1635             'win/pe_image_test.cc',
1636           ],
1637           'msvs_settings': {
1638             'VCLinkerTool': {
1639               'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
1640               'DelayLoadDLLs': [
1641                 'cfgmgr32.dll',
1642                 'shell32.dll',
1643               ],
1644               'AdditionalDependencies': [
1645                 'cfgmgr32.lib',
1646                 'shell32.lib',
1647               ],
1648             },
1649           },
1650         },
1651       ],
1652     }],
1653     ['test_isolation_mode != "noop"', {
1654       'targets': [
1655         {
1656           'target_name': 'base_unittests_run',
1657           'type': 'none',
1658           'dependencies': [
1659             'base_unittests',
1660           ],
1661           'includes': [
1662             '../build/isolate.gypi',
1663           ],
1664           'sources': [
1665             'base_unittests.isolate',
1666           ],
1667         },
1668       ],
1669     }],
1670   ],