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