Webkit roll 143935:143980
[chromium-blink-merge.git] / base / base.gyp
bloba17508a8f402b5db0cf3f67b3be3fa27b40a3ccc
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         ['use_glib==1', {
39           'conditions': [
40             ['chromeos==1', {
41               'sources/': [ ['include', '_chromeos\\.cc$'] ]
42             }],
43             ['linux_use_tcmalloc==0', {
44               'defines': [
45                 'NO_TCMALLOC',
46               ],
47               'direct_dependent_settings': {
48                 'defines': [
49                   'NO_TCMALLOC',
50                 ],
51               },
52             }],
53             ['toolkit_uses_gtk==1', {
54               'dependencies': [
55                 '../build/linux/system.gyp:gtk',
56               ],
57               'export_dependent_settings': [
58                 '../build/linux/system.gyp:gtk',
59               ],
60             }],
61           ],
62           'dependencies': [
63             'symbolize',
64             '../build/linux/system.gyp:glib',
65             '../build/linux/system.gyp:x11',
66             'xdg_mime',
67           ],
68           'defines': [
69             'USE_SYMBOLIZE',
70           ],
71           'cflags': [
72             '-Wno-write-strings',
73           ],
74           'export_dependent_settings': [
75             '../build/linux/system.gyp:glib',
76             '../build/linux/system.gyp:x11',
77           ],
78         }, {  # use_glib!=1
79             'sources/': [
80               ['exclude', '/xdg_user_dirs/'],
81               ['exclude', '_nss\\.cc$'],
82             ],
83         }],
84         ['OS == "android" and _toolset == "host"', {
85           # Base for host support is the minimum required to run the
86           # ssl false start blacklist tool. It requires further changes
87           # to generically support host builds (and tests).
88           # Note: when building for host, gyp has OS == "android",
89           # hence the *_android.cc files are included but the actual code
90           # doesn't have OS_ANDROID / ANDROID defined.
91           'conditions': [
92             # Host build on linux depends on system.gyp::gtk as
93             # default linux build has TOOLKIT_GTK defined.
94             ['host_os == "linux"', {
95               'sources/': [
96                 ['include', '^atomicops_internals_x86_gcc\\.cc$'],
97               ],
98               'dependencies': [
99                 '../build/linux/system.gyp:gtk',
100               ],
101               'export_dependent_settings': [
102                 '../build/linux/system.gyp:gtk',
103               ],
104             }],
105             ['host_os == "mac"', {
106               'sources/': [
107                 ['exclude', '^native_library_linux\\.cc$'],
108                 ['exclude', '^process_util_linux\\.cc$'],
109                 ['exclude', '^sys_info_linux\\.cc$'],
110                 ['exclude', '^sys_string_conversions_linux\\.cc$'],
111                 ['exclude', '^worker_pool_linux\\.cc$'],
112               ],
113             }],
114           ],
115         }],
116         ['OS == "android" and _toolset == "target"', {
117           'conditions': [
118             ['target_arch == "ia32"', {
119               'sources/': [
120                 ['include', '^atomicops_internals_x86_gcc\\.cc$'],
121               ],
122             }],
123           ],
124           'dependencies': [
125             'base_jni_headers',
126             'symbolize',
127             '../third_party/ashmem/ashmem.gyp:ashmem',
128             '../third_party/icu/icu.gyp:icuuc',
129           ],
130           'include_dirs': [
131             '<(SHARED_INTERMEDIATE_DIR)/base',
132           ],
133           'link_settings': {
134             'libraries': [
135               '-llog',
136             ],
137           },
138           'defines': [
139             'USE_SYMBOLIZE',
140           ],
141           'sources!': [
142             'debug/stack_trace_posix.cc',
143           ],
144           'includes': [
145             '../build/android/cpufeatures.gypi',
146           ],
147         }],
148         ['OS == "android" and _toolset == "target" and android_build_type == 0', {
149           'dependencies': [
150             'base_java',
151           ],
152         }],
153         ['os_bsd==1', {
154           'include_dirs': [
155             '/usr/local/include',
156           ],
157           'link_settings': {
158             'libraries': [
159               '-L/usr/local/lib -lexecinfo',
160             ],
161           },
162         }],
163         ['OS == "linux"', {
164           'link_settings': {
165             'libraries': [
166               # We need rt for clock_gettime().
167               '-lrt',
168               # For 'native_library_linux.cc'
169               '-ldl',
170             ],
171           },
172         }],
173         ['OS == "mac"', {
174           'link_settings': {
175             'libraries': [
176               '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
177               '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework',
178               '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
179               '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
180               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
181               '$(SDKROOT)/System/Library/Frameworks/IOKit.framework',
182               '$(SDKROOT)/System/Library/Frameworks/Security.framework',
183             ],
184           },
185           'dependencies': [
186             '../third_party/mach_override/mach_override.gyp:mach_override',
187           ],
188         }],
189         ['OS == "ios"', {
190           'link_settings': {
191             'libraries': [
192               '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
193               '$(SDKROOT)/System/Library/Frameworks/CoreGraphics.framework',
194               '$(SDKROOT)/System/Library/Frameworks/CoreText.framework',
195               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
196               '$(SDKROOT)/System/Library/Frameworks/UIKit.framework',
197             ],
198           },
199         }],
200         ['OS != "win" and OS != "ios"', {
201             'dependencies': ['../third_party/libevent/libevent.gyp:libevent'],
202         },],
203         ['component=="shared_library"', {
204           'conditions': [
205             ['OS=="win"', {
206               'sources!': [
207                 'debug/debug_on_start_win.cc',
208               ],
209             }],
210           ],
211         }],
212         ['use_system_nspr==1', {
213           'dependencies': [
214             'third_party/nspr/nspr.gyp:nspr',
215           ],
216         }],
217       ],
218       'sources': [
219         'third_party/nspr/prcpucfg.h',
220         'third_party/nspr/prcpucfg_win.h',
221         'third_party/nspr/prtypes.h',
222         'third_party/xdg_user_dirs/xdg_user_dir_lookup.cc',
223         'third_party/xdg_user_dirs/xdg_user_dir_lookup.h',
224         'auto_reset.h',
225         'event_recorder.h',
226         'event_recorder_stubs.cc',
227         'event_recorder_win.cc',
228         'linux_util.cc',
229         'linux_util.h',
230         'md5.cc',
231         'md5.h',
232         'message_pump_android.cc',
233         'message_pump_android.h',
234         'message_pump_glib.cc',
235         'message_pump_glib.h',
236         'message_pump_gtk.cc',
237         'message_pump_gtk.h',
238         'message_pump_io_ios.cc',
239         'message_pump_io_ios.h',
240         'message_pump_observer.h',
241         'message_pump_aurax11.cc',
242         'message_pump_aurax11.h',
243         'message_pump_libevent.cc',
244         'message_pump_libevent.h',
245         'message_pump_mac.h',
246         'message_pump_mac.mm',
247         'metrics/field_trial.cc',
248         'metrics/field_trial.h',
249         'posix/file_descriptor_shuffle.cc',
250         'posix/file_descriptor_shuffle.h',
251         'sync_socket.h',
252         'sync_socket_win.cc',
253         'sync_socket_posix.cc',
254       ],
255     },
256     {
257       'target_name': 'base_i18n',
258       'type': '<(component)',
259       'variables': {
260         'enable_wexit_time_destructors': 1,
261         'optimize': 'max',
262       },
263       'dependencies': [
264         'base',
265         'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
266         '../third_party/icu/icu.gyp:icui18n',
267         '../third_party/icu/icu.gyp:icuuc',
268       ],
269       'conditions': [
270         ['toolkit_uses_gtk==1', {
271           'dependencies': [
272             # i18n/rtl.cc uses gtk
273             '../build/linux/system.gyp:gtk',
274           ],
275         }],
276         ['OS == "win"', {
277           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
278           'msvs_disabled_warnings': [
279             4267,
280           ],
281         }],
282       ],
283       'export_dependent_settings': [
284         'base',
285       ],
286       'defines': [
287         'BASE_I18N_IMPLEMENTATION',
288       ],
289       'sources': [
290         'i18n/base_i18n_export.h',
291         'i18n/bidi_line_iterator.cc',
292         'i18n/bidi_line_iterator.h',
293         'i18n/break_iterator.cc',
294         'i18n/break_iterator.h',
295         'i18n/char_iterator.cc',
296         'i18n/char_iterator.h',
297         'i18n/case_conversion.cc',
298         'i18n/case_conversion.h',
299         'i18n/file_util_icu.cc',
300         'i18n/file_util_icu.h',
301         'i18n/icu_encoding_detection.cc',
302         'i18n/icu_encoding_detection.h',
303         'i18n/icu_string_conversions.cc',
304         'i18n/icu_string_conversions.h',
305         'i18n/icu_util.cc',
306         'i18n/icu_util.h',
307         'i18n/number_formatting.cc',
308         'i18n/number_formatting.h',
309         'i18n/rtl.cc',
310         'i18n/rtl.h',
311         'i18n/string_search.cc',
312         'i18n/string_search.h',
313         'i18n/time_formatting.cc',
314         'i18n/time_formatting.h',
315       ],
316     },
317     {
318       'target_name': 'base_prefs',
319       'type': '<(component)',
320       'variables': {
321         'enable_wexit_time_destructors': 1,
322         'optimize': 'max',
323       },
324       'dependencies': [
325         'base',
326       ],
327       'export_dependent_settings': [
328         'base',
329       ],
330       'defines': [
331         'BASE_PREFS_IMPLEMENTATION',
332       ],
333       'sources': [
334         'prefs/base_prefs_export.h',
335         'prefs/default_pref_store.cc',
336         'prefs/default_pref_store.h',
337         'prefs/json_pref_store.cc',
338         'prefs/json_pref_store.h',
339         'prefs/overlay_user_pref_store.cc',
340         'prefs/overlay_user_pref_store.h',
341         'prefs/persistent_pref_store.h',
342         'prefs/pref_notifier.h',
343         'prefs/pref_notifier_impl.cc',
344         'prefs/pref_notifier_impl.h',
345         'prefs/pref_observer.h',
346         'prefs/pref_registry.cc',
347         'prefs/pref_registry.h',
348         'prefs/pref_registry_simple.cc',
349         'prefs/pref_registry_simple.h',
350         'prefs/pref_service.cc',
351         'prefs/pref_service.h',
352         'prefs/pref_service_builder.cc',
353         'prefs/pref_service_builder.h',
354         'prefs/pref_store.cc',
355         'prefs/pref_store.h',
356         'prefs/pref_value_map.cc',
357         'prefs/pref_value_map.h',
358         'prefs/pref_value_store.cc',
359         'prefs/pref_value_store.h',
360         'prefs/public/pref_change_registrar.cc',
361         'prefs/public/pref_change_registrar.h',
362         'prefs/public/pref_member.cc',
363         'prefs/public/pref_member.h',
364         'prefs/value_map_pref_store.cc',
365         'prefs/value_map_pref_store.h',
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     },
407     # Include this target for a main() function that simply instantiates
408     # and runs a base::TestSuite.
409     {
410       'target_name': 'run_all_unittests',
411       'type': 'static_library',
412       'dependencies': [
413         'test_support_base',
414       ],
415       'sources': [
416         'test/run_all_unittests.cc',
417       ],
418     },
419     {
420       'target_name': 'base_unittests',
421       'type': '<(gtest_target_type)',
422       'sources': [
423         # Tests.
424         'android/jni_android_unittest.cc',
425         'android/jni_array_unittest.cc',
426         'android/jni_string_unittest.cc',
427         'android/path_utils_unittest.cc',
428         'android/scoped_java_ref_unittest.cc',
429         'at_exit_unittest.cc',
430         'atomicops_unittest.cc',
431         'base64_unittest.cc',
432         'bind_helpers_unittest.cc',
433         'bind_unittest.cc',
434         'bind_unittest.nc',
435         'bits_unittest.cc',
436         'build_time_unittest.cc',
437         'callback_unittest.cc',
438         'callback_unittest.nc',
439         'cancelable_callback_unittest.cc',
440         'command_line_unittest.cc',
441         'containers/linked_list_unittest.cc',
442         'containers/mru_cache_unittest.cc',
443         'containers/small_map_unittest.cc',
444         'containers/stack_container_unittest.cc',
445         'cpu_unittest.cc',
446         'debug/crash_logging_unittest.cc',
447         'debug/leak_tracker_unittest.cc',
448         'debug/stack_trace_unittest.cc',
449         'debug/trace_event_unittest.cc',
450         'debug/trace_event_unittest.h',
451         'debug/trace_event_win_unittest.cc',
452         'environment_unittest.cc',
453         'file_util_unittest.cc',
454         'file_version_info_unittest.cc',
455         'files/dir_reader_posix_unittest.cc',
456         'files/file_path_unittest.cc',
457         'files/file_util_proxy_unittest.cc',
458         'files/important_file_writer_unittest.cc',
459         'files/scoped_temp_dir_unittest.cc',
460         'gmock_unittest.cc',
461         'guid_unittest.cc',
462         'hi_res_timer_manager_unittest.cc',
463         'id_map_unittest.cc',
464         'i18n/break_iterator_unittest.cc',
465         'i18n/char_iterator_unittest.cc',
466         'i18n/case_conversion_unittest.cc',
467         'i18n/file_util_icu_unittest.cc',
468         'i18n/icu_string_conversions_unittest.cc',
469         'i18n/number_formatting_unittest.cc',
470         'i18n/rtl_unittest.cc',
471         'i18n/string_search_unittest.cc',
472         'i18n/time_formatting_unittest.cc',
473         'ios/device_util_unittest.mm',
474         'json/json_parser_unittest.cc',
475         'json/json_reader_unittest.cc',
476         'json/json_value_converter_unittest.cc',
477         'json/json_value_serializer_unittest.cc',
478         'json/json_writer_unittest.cc',
479         'json/string_escape_unittest.cc',
480         'lazy_instance_unittest.cc',
481         'logging_unittest.cc',
482         'mac/bind_objc_block_unittest.mm',
483         'mac/foundation_util_unittest.mm',
484         'mac/libdispatch_task_runner_unittest.cc',
485         'mac/mac_util_unittest.mm',
486         'mac/objc_property_releaser_unittest.mm',
487         'mac/scoped_sending_event_unittest.mm',
488         'md5_unittest.cc',
489         'memory/aligned_memory_unittest.cc',
490         'memory/discardable_memory_unittest.cc',
491         'memory/linked_ptr_unittest.cc',
492         'memory/ref_counted_memory_unittest.cc',
493         'memory/ref_counted_unittest.cc',
494         'memory/scoped_nsobject_unittest.mm',
495         'memory/scoped_ptr_unittest.cc',
496         'memory/scoped_ptr_unittest.nc',
497         'memory/scoped_vector_unittest.cc',
498         'memory/singleton_unittest.cc',
499         'memory/weak_ptr_unittest.cc',
500         'memory/weak_ptr_unittest.nc',
501         'message_loop_proxy_impl_unittest.cc',
502         'message_loop_proxy_unittest.cc',
503         'message_loop_unittest.cc',
504         'message_pump_glib_unittest.cc',
505         'message_pump_io_ios_unittest.cc',
506         'message_pump_libevent_unittest.cc',
507         'metrics/sample_map_unittest.cc',
508         'metrics/sample_vector_unittest.cc',
509         'metrics/bucket_ranges_unittest.cc',
510         'metrics/field_trial_unittest.cc',
511         'metrics/histogram_base_unittest.cc',
512         'metrics/histogram_unittest.cc',
513         'metrics/sparse_histogram_unittest.cc',
514         'metrics/stats_table_unittest.cc',
515         'metrics/statistics_recorder_unittest.cc',
516         'observer_list_unittest.cc',
517         'os_compat_android_unittest.cc',
518         'path_service_unittest.cc',
519         'pickle_unittest.cc',
520         'platform_file_unittest.cc',
521         'posix/file_descriptor_shuffle_unittest.cc',
522         'posix/unix_domain_socket_linux_unittest.cc',
523         'pr_time_unittest.cc',
524         'prefs/json_pref_store_unittest.cc',
525         'prefs/mock_pref_change_callback.h',
526         'prefs/overlay_user_pref_store_unittest.cc',
527         'prefs/pref_notifier_impl_unittest.cc',
528         'prefs/pref_service_unittest.cc',
529         'prefs/pref_value_map_unittest.cc',
530         'prefs/pref_value_store_unittest.cc',
531         'prefs/public/pref_change_registrar_unittest.cc',
532         'prefs/public/pref_member_unittest.cc',
533         'process_util_unittest.cc',
534         'process_util_unittest_ios.cc',
535         'process_util_unittest_mac.h',
536         'process_util_unittest_mac.mm',
537         'profiler/tracked_time_unittest.cc',
538         'rand_util_unittest.cc',
539         'safe_numerics_unittest.cc',
540         'safe_numerics_unittest.nc',
541         'scoped_native_library_unittest.cc',
542         'scoped_observer.h',
543         'security_unittest.cc',
544         'sequence_checker_unittest.cc',
545         'sequence_checker_impl_unittest.cc',
546         'sha1_unittest.cc',
547         'shared_memory_unittest.cc',
548         'stl_util_unittest.cc',
549         'string16_unittest.cc',
550         'string_piece_unittest.cc',
551         'string_util_unittest.cc',
552         'stringprintf_unittest.cc',
553         'strings/string_number_conversions_unittest.cc',
554         'strings/string_split_unittest.cc',
555         'strings/string_tokenizer_unittest.cc',
556         'strings/stringize_macros_unittest.cc',
557         'strings/sys_string_conversions_mac_unittest.mm',
558         'strings/sys_string_conversions_unittest.cc',
559         'strings/utf_offset_string_conversions_unittest.cc',
560         'synchronization/cancellation_flag_unittest.cc',
561         'synchronization/condition_variable_unittest.cc',
562         'synchronization/lock_unittest.cc',
563         'synchronization/waitable_event_unittest.cc',
564         'synchronization/waitable_event_watcher_unittest.cc',
565         'sys_info_unittest.cc',
566         'system_monitor/system_monitor_unittest.cc',
567         'task_runner_util_unittest.cc',
568         'template_util_unittest.cc',
569         'test/expectations/expectation_unittest.cc',
570         'test/expectations/parser_unittest.cc',
571         'test/sequenced_worker_pool_owner.cc',
572         'test/sequenced_worker_pool_owner.h',
573         'test/trace_event_analyzer_unittest.cc',
574         'threading/non_thread_safe_unittest.cc',
575         'threading/platform_thread_unittest.cc',
576         'threading/sequenced_worker_pool_unittest.cc',
577         'threading/simple_thread_unittest.cc',
578         'threading/thread_checker_unittest.cc',
579         'threading/thread_collision_warner_unittest.cc',
580         'threading/thread_id_name_manager_unittest.cc',
581         'threading/thread_local_storage_unittest.cc',
582         'threading/thread_local_unittest.cc',
583         'threading/thread_unittest.cc',
584         'threading/watchdog_unittest.cc',
585         'threading/worker_pool_posix_unittest.cc',
586         'threading/worker_pool_unittest.cc',
587         'time_unittest.cc',
588         'time_win_unittest.cc',
589         'timer_unittest.cc',
590         'tools_sanity_unittest.cc',
591         'tracked_objects_unittest.cc',
592         'tuple_unittest.cc',
593         'utf_string_conversions_unittest.cc',
594         'values_unittest.cc',
595         'version_unittest.cc',
596         'vlog_unittest.cc',
597         'win/dllmain.cc',
598         'win/enum_variant_unittest.cc',
599         'win/event_trace_consumer_unittest.cc',
600         'win/event_trace_controller_unittest.cc',
601         'win/event_trace_provider_unittest.cc',
602         'win/i18n_unittest.cc',
603         'win/iunknown_impl_unittest.cc',
604         'win/object_watcher_unittest.cc',
605         'win/pe_image_unittest.cc',
606         'win/registry_unittest.cc',
607         'win/sampling_profiler_unittest.cc',
608         'win/scoped_bstr_unittest.cc',
609         'win/scoped_comptr_unittest.cc',
610         'win/scoped_handle_unittest.cc',
611         'win/scoped_process_information_unittest.cc',
612         'win/shortcut_unittest.cc',
613         'win/startup_information_unittest.cc',
614         'win/scoped_variant_unittest.cc',
615         'win/win_util_unittest.cc',
616         'win/wrapped_window_proc_unittest.cc',
617       ],
618       'dependencies': [
619         'base',
620         'base_i18n',
621         'base_prefs',
622         'base_prefs_test_support',
623         'base_static',
624         'run_all_unittests',
625         'test_support_base',
626         'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
627         '../testing/gmock.gyp:gmock',
628         '../testing/gtest.gyp:gtest',
629         '../third_party/icu/icu.gyp:icui18n',
630         '../third_party/icu/icu.gyp:icuuc',
631       ],
632       'includes': ['../build/nocompile.gypi'],
633       'variables': {
634          # TODO(ajwong): Is there a way to autodetect this?
635         'module_dir': 'base'
636       },
637       'conditions': [
638         ['OS == "android"', {
639           'dependencies': [
640             'android/jni_generator/jni_generator.gyp:jni_generator_tests',
641           ],
642           'conditions': [
643             ['gtest_target_type == "shared_library"', {
644               'dependencies': [
645                 '../testing/android/native_test.gyp:native_test_native_code',
646               ],
647             }],
648           ],
649           'sources!': [
650             # Broken on Android, and already disabled there.
651             'debug/stack_trace_unittest.cc',
652           ],
653         }],
654         ['OS == "ios"', {
655           'sources/': [
656             # Only test the iOS-meaningful portion of process_utils.
657             ['exclude', '^process_util_unittest'],
658             ['include', '^process_util_unittest_ios\\.cc$'],
659             # Requires spawning processes.
660             ['exclude', '^metrics/stats_table_unittest\\.cc$'],
661             # iOS does not use message_pump_libevent.
662             ['exclude', '^message_pump_libevent_unittest\\.cc$'],
663             ['exclude', '^prefs/json_pref_store_unittest.\\cc$'],
665           ],
666           'conditions': [
667             ['coverage != 0', {
668               'sources!': [
669                 # These sources can't be built with coverage due to a toolchain
670                 # bug: http://openradar.appspot.com/radar?id=1499403
671                 'json/json_reader_unittest.cc',
672                 'string_piece_unittest.cc',
674                 # These tests crash when run with coverage turned on due to an
675                 # issue with llvm_gcda_increment_indirect_counter:
676                 # http://crbug.com/156058
677                 'debug/trace_event_unittest.cc',
678                 'debug/trace_event_unittest.h',
679                 'logging_unittest.cc',
680                 'string_util_unittest.cc',
681                 'test/trace_event_analyzer_unittest.cc',
682                 'utf_offset_string_conversions_unittest.cc',
683               ],
684             }],
685           ],
686           'actions': [
687             {
688               'action_name': 'copy_test_data',
689               'variables': {
690                 'test_data_files': [
691                   'data/json/bom_feff.json',
692                   'data/file_util_unittest',
693                 ],
694                 'test_data_prefix': 'base',
695               },
696               'includes': [ '../build/copy_test_data_ios.gypi' ],
697             },
698           ],
699         }],
700         ['use_glib==1', {
701           'sources!': [
702             'file_version_info_unittest.cc',
703           ],
704           'conditions': [
705             [ 'linux_use_tcmalloc==1', {
706                 'dependencies': [
707                   'allocator/allocator.gyp:allocator',
708                 ],
709               },
710             ],
711             [ 'toolkit_uses_gtk==1', {
712               'sources': [
713                 'nix/xdg_util_unittest.cc',
714               ],
715               'dependencies': [
716                 '../build/linux/system.gyp:gtk',
717               ]
718             }],
719           ],
720           'dependencies': [
721             '../build/linux/system.gyp:glib',
722             '../build/linux/system.gyp:ssl',
723             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
724           ],
725         }, {  # use_glib!=1
726           'sources!': [
727             'message_pump_glib_unittest.cc',
728           ]
729         }],
730         # This is needed to trigger the dll copy step on windows.
731         # TODO(mark): This should not be necessary.
732         ['OS == "win"', {
733           'dependencies': [
734             '../third_party/icu/icu.gyp:icudata',
735           ],
736           'sources!': [
737             'file_descriptor_shuffle_unittest.cc',
738             'files/dir_reader_posix_unittest.cc',
739             'threading/worker_pool_posix_unittest.cc',
740             'message_pump_libevent_unittest.cc',
741           ],
742           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
743           'msvs_disabled_warnings': [
744             4267,
745           ],
746         }, {  # OS != "win"
747           'dependencies': [
748             '../third_party/libevent/libevent.gyp:libevent'
749           ],
750           'sources/': [
751             ['exclude', '^win/'],
752           ],
753           'sources!': [
754             'debug/trace_event_win_unittest.cc',
755             'time_win_unittest.cc',
756             'win/win_util_unittest.cc',
757           ],
758         }],
759         ['use_system_nspr==1', {
760           'dependencies': [
761             'third_party/nspr/nspr.gyp:nspr',
762           ],
763         }],
764       ],  # conditions
765       'target_conditions': [
766         ['OS == "ios"', {
767           'sources/': [
768             # Pull in specific Mac files for iOS (which have been filtered out
769             # by file name rules).
770             ['include', '^mac/objc_property_releaser_unittest\\.mm$'],
771             ['include', '^mac/bind_objc_block_unittest\\.mm$'],
772             ['include', '^sys_string_conversions_mac_unittest\\.mm$'],
773           ],
774         }],
775       ],  # target_conditions
776     },
777     {
778       'target_name': 'test_support_base',
779       'type': 'static_library',
780       'dependencies': [
781         'base',
782         'base_static',
783         'base_i18n',
784         '../testing/gmock.gyp:gmock',
785         '../testing/gtest.gyp:gtest',
786       ],
787       'export_dependent_settings': [
788         'base',
789       ],
790       'conditions': [
791         ['toolkit_uses_gtk==1', {
792           'dependencies': [
793             # test_suite initializes GTK.
794             '../build/linux/system.gyp:gtk',
795           ],
796         }],
797         ['os_posix==0', {
798           'sources!': [
799             'test/scoped_locale.cc',
800             'test/scoped_locale.h',
801           ],
802         }],
803         ['os_bsd==1', {
804           'sources!': [
805             'test/test_file_util_linux.cc',
806           ],
807         }],
808       ],
809       'sources': [
810         'perftimer.cc',
811         'test/expectations/expectation.cc',
812         'test/expectations/expectation.h',
813         'test/expectations/parser.cc',
814         'test/expectations/parser.h',
815         'test/main_hook.cc',
816         'test/main_hook.h',
817         'test/main_hook_ios.mm',
818         'test/mock_chrome_application_mac.h',
819         'test/mock_chrome_application_mac.mm',
820         'test/mock_devices_changed_observer.cc',
821         'test/mock_devices_changed_observer.h',
822         'test/mock_time_provider.cc',
823         'test/mock_time_provider.h',
824         'test/multiprocess_test.cc',
825         'test/multiprocess_test.h',
826         'test/multiprocess_test_android.cc',
827         'test/null_task_runner.cc',
828         'test/null_task_runner.h',
829         'test/perf_test_suite.cc',
830         'test/perf_test_suite.h',
831         'test/scoped_locale.cc',
832         'test/scoped_locale.h',
833         'test/scoped_path_override.cc',
834         'test/scoped_path_override.h',
835         'test/sequenced_task_runner_test_template.cc',
836         'test/sequenced_task_runner_test_template.h',
837         'test/simple_test_clock.cc',
838         'test/simple_test_clock.h',
839         'test/simple_test_tick_clock.cc',
840         'test/simple_test_tick_clock.h',
841         'test/task_runner_test_template.cc',
842         'test/task_runner_test_template.h',
843         'test/test_file_util.h',
844         'test/test_file_util_linux.cc',
845         'test/test_file_util_mac.cc',
846         'test/test_file_util_posix.cc',
847         'test/test_file_util_win.cc',
848         'test/test_listener_ios.h',
849         'test/test_listener_ios.mm',
850         'test/test_pending_task.cc',
851         'test/test_pending_task.h',
852         'test/test_process_killer_win.cc',
853         'test/test_process_killer_win.h',
854         'test/test_reg_util_win.cc',
855         'test/test_reg_util_win.h',
856         'test/test_shortcut_win.cc',
857         'test/test_shortcut_win.h',
858         'test/test_simple_task_runner.cc',
859         'test/test_simple_task_runner.h',
860         'test/test_suite.cc',
861         'test/test_suite.h',
862         'test/test_support_android.cc',
863         'test/test_support_android.h',
864         'test/test_support_ios.h',
865         'test/test_support_ios.mm',
866         'test/test_switches.cc',
867         'test/test_switches.h',
868         'test/test_timeouts.cc',
869         'test/test_timeouts.h',
870         'test/thread_test_helper.cc',
871         'test/thread_test_helper.h',
872         'test/trace_event_analyzer.cc',
873         'test/trace_event_analyzer.h',
874         'test/values_test_util.cc',
875         'test/values_test_util.h',
876       ],
877       'target_conditions': [
878         ['OS == "ios"', {
879           'sources/': [
880             # Pull in specific Mac files for iOS (which have been filtered out
881             # by file name rules).
882             ['include', '^test/test_file_util_mac\\.cc$'],
883           ],
884         }],
885       ],  # target_conditions
886     },
887     {
888       'target_name': 'test_support_perf',
889       'type': 'static_library',
890       'dependencies': [
891         'base',
892         '../testing/gtest.gyp:gtest',
893       ],
894       'sources': [
895         'perftimer.cc',
896         'test/run_all_perftests.cc',
897       ],
898       'direct_dependent_settings': {
899         'defines': [
900           'PERF_TEST',
901         ],
902       },
903       'conditions': [
904         ['toolkit_uses_gtk==1', {
905           'dependencies': [
906             # Needed to handle the #include chain:
907             #   base/test/perf_test_suite.h
908             #   base/test/test_suite.h
909             #   gtk/gtk.h
910             '../build/linux/system.gyp:gtk',
911           ],
912         }],
913       ],
914     },
915   ],
916   'conditions': [
917     ['OS!="ios"', {
918       'targets': [
919         {
920           'target_name': 'check_example',
921           'type': 'executable',
922           'sources': [
923             'check_example.cc',
924           ],
925           'dependencies': [
926             'base',
927           ],
928         },
929       ],
930     }],
931     ['OS == "win" and target_arch=="ia32"', {
932       'targets': [
933         {
934           'target_name': 'base_nacl_win64',
935           'type': '<(component)',
936           'variables': {
937             'base_target': 1,
938           },
939           'dependencies': [
940             'base_static_win64',
941             'allocator/allocator.gyp:allocator_extension_thunks_win64',
942             'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
943           ],
944           # TODO(gregoryd): direct_dependent_settings should be shared with the
945           # 32-bit target, but it doesn't work due to a bug in gyp
946           'direct_dependent_settings': {
947             'include_dirs': [
948               '..',
949             ],
950           },
951           'defines': [
952             '<@(nacl_win64_defines)',
953           ],
954           'sources!': [
955             # base64.cc depends on modp_b64.
956             'base64.cc',
957           ],
958           'configurations': {
959             'Common_Base': {
960               'msvs_target_platform': 'x64',
961             },
962           },
963           'conditions': [
964             ['component == "shared_library"', {
965               'sources!': [
966                 'debug/debug_on_start_win.cc',
967               ],
968             }],
969           ],
970         },
971         {
972           'target_name': 'base_i18n_nacl_win64',
973           'type': '<(component)',
974           # TODO(gregoryd): direct_dependent_settings should be shared with the
975           # 32-bit target, but it doesn't work due to a bug in gyp
976           'direct_dependent_settings': {
977             'include_dirs': [
978               '..',
979             ],
980           },
981           'defines': [
982             '<@(nacl_win64_defines)',
983             'BASE_I18N_IMPLEMENTATION',
984           ],
985           'include_dirs': [
986             '..',
987           ],
988           'sources': [
989             'i18n/icu_util_nacl_win64.cc',
990           ],
991           'configurations': {
992             'Common_Base': {
993               'msvs_target_platform': 'x64',
994             },
995           },
996         },
997         {
998           # TODO(rvargas): Remove this when gyp finally supports a clean model.
999           # See bug 36232.
1000           'target_name': 'base_static_win64',
1001           'type': 'static_library',
1002           'sources': [
1003             'base_switches.cc',
1004             'base_switches.h',
1005             'win/pe_image.cc',
1006             'win/pe_image.h',
1007           ],
1008           'sources!': [
1009             # base64.cc depends on modp_b64.
1010             'base64.cc',
1011           ],
1012           'include_dirs': [
1013             '..',
1014           ],
1015           'configurations': {
1016             'Common_Base': {
1017               'msvs_target_platform': 'x64',
1018             },
1019           },
1020           'defines': [
1021             'NACL_WIN64',
1022           ],
1023           # TODO(rvargas): Bug 78117. Remove this.
1024           'msvs_disabled_warnings': [
1025             4244,
1026           ],
1027         },
1028       ],
1029     }],
1030     ['os_posix==1 and OS!="mac" and OS!="ios"', {
1031       'targets': [
1032         {
1033           'target_name': 'symbolize',
1034           'type': 'static_library',
1035           'toolsets': ['host', 'target'],
1036           'variables': {
1037             'chromium_code': 0,
1038           },
1039           'conditions': [
1040             ['OS == "solaris"', {
1041               'include_dirs': [
1042                 '/usr/gnu/include',
1043                 '/usr/gnu/include/libelf',
1044               ],
1045             },],
1046           ],
1047           'cflags': [
1048             '-Wno-sign-compare',
1049           ],
1050           'cflags!': [
1051             '-Wextra',
1052           ],
1053           'sources': [
1054             'third_party/symbolize/config.h',
1055             'third_party/symbolize/demangle.cc',
1056             'third_party/symbolize/demangle.h',
1057             'third_party/symbolize/glog/logging.h',
1058             'third_party/symbolize/glog/raw_logging.h',
1059             'third_party/symbolize/symbolize.cc',
1060             'third_party/symbolize/symbolize.h',
1061             'third_party/symbolize/utilities.h',
1062           ],
1063           'include_dirs': [
1064             '..',
1065           ],
1066         },
1067         {
1068           'target_name': 'xdg_mime',
1069           'type': 'static_library',
1070           'toolsets': ['host', 'target'],
1071           'variables': {
1072             'chromium_code': 0,
1073           },
1074           'cflags!': [
1075             '-Wextra',
1076           ],
1077           'sources': [
1078             'third_party/xdg_mime/xdgmime.c',
1079             'third_party/xdg_mime/xdgmime.h',
1080             'third_party/xdg_mime/xdgmimealias.c',
1081             'third_party/xdg_mime/xdgmimealias.h',
1082             'third_party/xdg_mime/xdgmimecache.c',
1083             'third_party/xdg_mime/xdgmimecache.h',
1084             'third_party/xdg_mime/xdgmimeglob.c',
1085             'third_party/xdg_mime/xdgmimeglob.h',
1086             'third_party/xdg_mime/xdgmimeicon.c',
1087             'third_party/xdg_mime/xdgmimeicon.h',
1088             'third_party/xdg_mime/xdgmimeint.c',
1089             'third_party/xdg_mime/xdgmimeint.h',
1090             'third_party/xdg_mime/xdgmimemagic.c',
1091             'third_party/xdg_mime/xdgmimemagic.h',
1092             'third_party/xdg_mime/xdgmimeparent.c',
1093             'third_party/xdg_mime/xdgmimeparent.h',
1094           ],
1095         },
1096       ],
1097     }],
1098     ['OS == "android"', {
1099       'targets': [
1100         {
1101           'target_name': 'base_jni_headers',
1102           'type': 'none',
1103           'sources': [
1104             'android/java/src/org/chromium/base/BuildInfo.java',
1105             'android/java/src/org/chromium/base/CpuFeatures.java',
1106             'android/java/src/org/chromium/base/LocaleUtils.java',
1107             'android/java/src/org/chromium/base/PathService.java',
1108             'android/java/src/org/chromium/base/PathUtils.java',
1109             'android/java/src/org/chromium/base/SystemMessageHandler.java',
1110             'android/java/src/org/chromium/base/SystemMonitor.java',
1111             'android/java/src/org/chromium/base/ThreadUtils.java',
1112           ],
1113           'variables': {
1114             'jni_gen_dir': 'base',
1115           },
1116           'includes': [ '../build/jni_generator.gypi' ],
1117         },
1118         {
1119           'target_name': 'base_java',
1120           'type': 'none',
1121           'variables': {
1122             'java_in_dir': '../base/android/java',
1123           },
1124           'includes': [ '../build/java.gypi' ],
1125         },
1126         {
1127           'target_name': 'base_java_test_support',
1128           'type': 'none',
1129           'dependencies': [
1130             'base_java',
1131           ],
1132           'variables': {
1133             'java_in_dir': '../base/test/android/javatests',
1134           },
1135           'includes': [ '../build/java.gypi' ],
1136         },
1137       ],
1138     }],
1139     ['OS == "win"', {
1140       'targets': [
1141         {
1142           'target_name': 'debug_message',
1143           'type': 'executable',
1144           'sources': [
1145             'debug_message.cc',
1146           ],
1147           'msvs_settings': {
1148             'VCLinkerTool': {
1149               'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
1150             },
1151           },
1152         },
1153       ],
1154     }],
1155     # Special target to wrap a gtest_target_type == shared_library
1156     # base_unittests into an android apk for execution.
1157     # TODO(jrg): lib.target comes from _InstallableTargetInstallPath()
1158     # in the gyp make generator.  What is the correct way to extract
1159     # this path from gyp and into 'raw' for input to antfiles?
1160     # Hard-coding in the gypfile seems a poor choice.
1161     ['OS == "android" and gtest_target_type == "shared_library"', {
1162       'targets': [
1163         {
1164           'target_name': 'base_unittests_apk',
1165           'type': 'none',
1166           'dependencies': [
1167             'base_java',
1168             'base_unittests',
1169           ],
1170           'variables': {
1171             'test_suite_name': 'base_unittests',
1172             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)base_unittests<(SHARED_LIB_SUFFIX)',
1173           },
1174           'includes': [ '../build/apk_test.gypi' ],
1175         },
1176       ],
1177     }],
1178     ['test_isolation_mode != "noop"', {
1179       'targets': [
1180         {
1181           'target_name': 'base_unittests_run',
1182           'type': 'none',
1183           'dependencies': [
1184             'base_unittests',
1185           ],
1186           'includes': [
1187             '../build/isolate.gypi',
1188             'base_unittests.isolate',
1189           ],
1190           'sources': [
1191             'base_unittests.isolate',
1192           ],
1193         },
1194       ],
1195     }],
1196   ],