Adding owners for third_party
[chromium-blink-merge.git] / base / base.gyp
blob2793e538f5fb324e8f7041866c6dc7112e04b8bd
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/public/pref_service_base.h',
365         'prefs/value_map_pref_store.cc',
366         'prefs/value_map_pref_store.h',
367       ],
368     },
369     {
370       'target_name': 'base_prefs_test_support',
371       'type': 'static_library',
372       'dependencies': [
373         'base',
374         'base_prefs',
375         '../testing/gmock.gyp:gmock',
376       ],
377       'sources': [
378         'prefs/mock_pref_change_callback.cc',
379         'prefs/pref_store_observer_mock.cc',
380         'prefs/pref_store_observer_mock.h',
381         'prefs/testing_pref_store.cc',
382         'prefs/testing_pref_store.h',
383       ],
384     },
385     {
386       # This is the subset of files from base that should not be used with a
387       # dynamic library. Note that this library cannot depend on base because
388       # base depends on base_static.
389       'target_name': 'base_static',
390       'type': 'static_library',
391       'variables': {
392         'enable_wexit_time_destructors': 1,
393         'optimize': 'max',
394       },
395       'toolsets': ['host', 'target'],
396       'sources': [
397         'base_switches.cc',
398         'base_switches.h',
399         'win/pe_image.cc',
400         'win/pe_image.h',
401       ],
402       'include_dirs': [
403         '..',
404       ],
405     },
406     # Include this target for a main() function that simply instantiates
407     # and runs a base::TestSuite.
408     {
409       'target_name': 'run_all_unittests',
410       'type': 'static_library',
411       'dependencies': [
412         'test_support_base',
413       ],
414       'sources': [
415         'test/run_all_unittests.cc',
416       ],
417     },
418     {
419       'target_name': 'base_unittests',
420       'type': '<(gtest_target_type)',
421       'sources': [
422         # Tests.
423         'android/jni_android_unittest.cc',
424         'android/jni_array_unittest.cc',
425         'android/jni_string_unittest.cc',
426         'android/path_utils_unittest.cc',
427         'android/scoped_java_ref_unittest.cc',
428         'at_exit_unittest.cc',
429         'atomicops_unittest.cc',
430         'base64_unittest.cc',
431         'bind_helpers_unittest.cc',
432         'bind_unittest.cc',
433         'bind_unittest.nc',
434         'bits_unittest.cc',
435         'build_time_unittest.cc',
436         'callback_unittest.cc',
437         'callback_unittest.nc',
438         'cancelable_callback_unittest.cc',
439         'command_line_unittest.cc',
440         'containers/linked_list_unittest.cc',
441         'containers/mru_cache_unittest.cc',
442         'containers/small_map_unittest.cc',
443         'containers/stack_container_unittest.cc',
444         'cpu_unittest.cc',
445         'debug/crash_logging_unittest.cc',
446         'debug/leak_tracker_unittest.cc',
447         'debug/stack_trace_unittest.cc',
448         'debug/trace_event_unittest.cc',
449         'debug/trace_event_unittest.h',
450         'debug/trace_event_win_unittest.cc',
451         'environment_unittest.cc',
452         'file_path_unittest.cc',
453         'file_util_unittest.cc',
454         'file_version_info_unittest.cc',
455         'files/dir_reader_posix_unittest.cc',
456         'files/file_util_proxy_unittest.cc',
457         'files/important_file_writer_unittest.cc',
458         'files/scoped_temp_dir_unittest.cc',
459         'gmock_unittest.cc',
460         'guid_unittest.cc',
461         'hi_res_timer_manager_unittest.cc',
462         'id_map_unittest.cc',
463         'i18n/break_iterator_unittest.cc',
464         'i18n/char_iterator_unittest.cc',
465         'i18n/case_conversion_unittest.cc',
466         'i18n/file_util_icu_unittest.cc',
467         'i18n/icu_string_conversions_unittest.cc',
468         'i18n/number_formatting_unittest.cc',
469         'i18n/rtl_unittest.cc',
470         'i18n/string_search_unittest.cc',
471         'i18n/time_formatting_unittest.cc',
472         'ios/device_util_unittest.mm',
473         'json/json_parser_unittest.cc',
474         'json/json_reader_unittest.cc',
475         'json/json_value_converter_unittest.cc',
476         'json/json_value_serializer_unittest.cc',
477         'json/json_writer_unittest.cc',
478         'json/string_escape_unittest.cc',
479         'lazy_instance_unittest.cc',
480         'logging_unittest.cc',
481         'mac/bind_objc_block_unittest.mm',
482         'mac/foundation_util_unittest.mm',
483         'mac/libdispatch_task_runner_unittest.cc',
484         'mac/mac_util_unittest.mm',
485         'mac/objc_property_releaser_unittest.mm',
486         'mac/scoped_sending_event_unittest.mm',
487         'md5_unittest.cc',
488         'memory/aligned_memory_unittest.cc',
489         'memory/discardable_memory_unittest.cc',
490         'memory/linked_ptr_unittest.cc',
491         'memory/ref_counted_memory_unittest.cc',
492         'memory/ref_counted_unittest.cc',
493         'memory/scoped_nsobject_unittest.mm',
494         'memory/scoped_ptr_unittest.cc',
495         'memory/scoped_ptr_unittest.nc',
496         'memory/scoped_vector_unittest.cc',
497         'memory/singleton_unittest.cc',
498         'memory/weak_ptr_unittest.cc',
499         'memory/weak_ptr_unittest.nc',
500         'message_loop_proxy_impl_unittest.cc',
501         'message_loop_proxy_unittest.cc',
502         'message_loop_unittest.cc',
503         'message_pump_glib_unittest.cc',
504         'message_pump_io_ios_unittest.cc',
505         'message_pump_libevent_unittest.cc',
506         'metrics/sample_map_unittest.cc',
507         'metrics/sample_vector_unittest.cc',
508         'metrics/bucket_ranges_unittest.cc',
509         'metrics/field_trial_unittest.cc',
510         'metrics/histogram_base_unittest.cc',
511         'metrics/histogram_unittest.cc',
512         'metrics/sparse_histogram_unittest.cc',
513         'metrics/stats_table_unittest.cc',
514         'metrics/statistics_recorder_unittest.cc',
515         'observer_list_unittest.cc',
516         'os_compat_android_unittest.cc',
517         'path_service_unittest.cc',
518         'pickle_unittest.cc',
519         'platform_file_unittest.cc',
520         'posix/file_descriptor_shuffle_unittest.cc',
521         'posix/unix_domain_socket_linux_unittest.cc',
522         'pr_time_unittest.cc',
523         'prefs/json_pref_store_unittest.cc',
524         'prefs/mock_pref_change_callback.h',
525         'prefs/overlay_user_pref_store_unittest.cc',
526         'prefs/pref_value_map_unittest.cc',
527         'prefs/pref_value_store_unittest.cc',
528         'process_util_unittest.cc',
529         'process_util_unittest_ios.cc',
530         'process_util_unittest_mac.h',
531         'process_util_unittest_mac.mm',
532         'profiler/tracked_time_unittest.cc',
533         'rand_util_unittest.cc',
534         'safe_numerics_unittest.cc',
535         'safe_numerics_unittest.nc',
536         'scoped_native_library_unittest.cc',
537         'scoped_observer.h',
538         'security_unittest.cc',
539         'sequence_checker_unittest.cc',
540         'sequence_checker_impl_unittest.cc',
541         'sha1_unittest.cc',
542         'shared_memory_unittest.cc',
543         'stl_util_unittest.cc',
544         'string16_unittest.cc',
545         'string_piece_unittest.cc',
546         'string_util_unittest.cc',
547         'stringprintf_unittest.cc',
548         'strings/string_number_conversions_unittest.cc',
549         'strings/string_split_unittest.cc',
550         'strings/string_tokenizer_unittest.cc',
551         'strings/stringize_macros_unittest.cc',
552         'strings/sys_string_conversions_mac_unittest.mm',
553         'strings/sys_string_conversions_unittest.cc',
554         'strings/utf_offset_string_conversions_unittest.cc',
555         'synchronization/cancellation_flag_unittest.cc',
556         'synchronization/condition_variable_unittest.cc',
557         'synchronization/lock_unittest.cc',
558         'synchronization/waitable_event_unittest.cc',
559         'synchronization/waitable_event_watcher_unittest.cc',
560         'sys_info_unittest.cc',
561         'system_monitor/system_monitor_unittest.cc',
562         'task_runner_util_unittest.cc',
563         'template_util_unittest.cc',
564         'test/expectations/expectation_unittest.cc',
565         'test/expectations/parser_unittest.cc',
566         'test/sequenced_worker_pool_owner.cc',
567         'test/sequenced_worker_pool_owner.h',
568         'test/trace_event_analyzer_unittest.cc',
569         'threading/non_thread_safe_unittest.cc',
570         'threading/platform_thread_unittest.cc',
571         'threading/sequenced_worker_pool_unittest.cc',
572         'threading/simple_thread_unittest.cc',
573         'threading/thread_checker_unittest.cc',
574         'threading/thread_collision_warner_unittest.cc',
575         'threading/thread_id_name_manager_unittest.cc',
576         'threading/thread_local_storage_unittest.cc',
577         'threading/thread_local_unittest.cc',
578         'threading/thread_unittest.cc',
579         'threading/watchdog_unittest.cc',
580         'threading/worker_pool_posix_unittest.cc',
581         'threading/worker_pool_unittest.cc',
582         'time_unittest.cc',
583         'time_win_unittest.cc',
584         'timer_unittest.cc',
585         'tools_sanity_unittest.cc',
586         'tracked_objects_unittest.cc',
587         'tuple_unittest.cc',
588         'utf_string_conversions_unittest.cc',
589         'values_unittest.cc',
590         'version_unittest.cc',
591         'vlog_unittest.cc',
592         'win/dllmain.cc',
593         'win/enum_variant_unittest.cc',
594         'win/event_trace_consumer_unittest.cc',
595         'win/event_trace_controller_unittest.cc',
596         'win/event_trace_provider_unittest.cc',
597         'win/i18n_unittest.cc',
598         'win/iunknown_impl_unittest.cc',
599         'win/object_watcher_unittest.cc',
600         'win/pe_image_unittest.cc',
601         'win/registry_unittest.cc',
602         'win/sampling_profiler_unittest.cc',
603         'win/scoped_bstr_unittest.cc',
604         'win/scoped_comptr_unittest.cc',
605         'win/scoped_handle_unittest.cc',
606         'win/scoped_process_information_unittest.cc',
607         'win/shortcut_unittest.cc',
608         'win/startup_information_unittest.cc',
609         'win/scoped_variant_unittest.cc',
610         'win/win_util_unittest.cc',
611         'win/wrapped_window_proc_unittest.cc',
612       ],
613       'dependencies': [
614         'base',
615         'base_i18n',
616         'base_prefs',
617         'base_prefs_test_support',
618         'base_static',
619         'run_all_unittests',
620         'test_support_base',
621         'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
622         '../testing/gmock.gyp:gmock',
623         '../testing/gtest.gyp:gtest',
624         '../third_party/icu/icu.gyp:icui18n',
625         '../third_party/icu/icu.gyp:icuuc',
626       ],
627       'includes': ['../build/nocompile.gypi'],
628       'variables': {
629          # TODO(ajwong): Is there a way to autodetect this?
630         'module_dir': 'base'
631       },
632       'conditions': [
633         ['OS == "android"', {
634           'dependencies': [
635             'android/jni_generator/jni_generator.gyp:jni_generator_tests',
636           ],
637           'conditions': [
638             ['gtest_target_type == "shared_library"', {
639               'dependencies': [
640                 '../testing/android/native_test.gyp:native_test_native_code',
641               ],
642             }],
643           ],
644           'sources!': [
645             # Broken on Android, and already disabled there.
646             'debug/stack_trace_unittest.cc',
647           ],
648         }],
649         ['OS == "ios"', {
650           'sources/': [
651             # Only test the iOS-meaningful portion of process_utils.
652             ['exclude', '^process_util_unittest'],
653             ['include', '^process_util_unittest_ios\\.cc$'],
654             # Requires spawning processes.
655             ['exclude', '^metrics/stats_table_unittest\\.cc$'],
656             # iOS does not use message_pump_libevent.
657             ['exclude', '^message_pump_libevent_unittest\\.cc$'],
658             ['exclude', '^prefs/json_pref_store_unittest.\\cc$'],
660           ],
661           'conditions': [
662             ['coverage != 0', {
663               'sources!': [
664                 # These sources can't be built with coverage due to a toolchain
665                 # bug: http://openradar.appspot.com/radar?id=1499403
666                 'json/json_reader_unittest.cc',
667                 'string_piece_unittest.cc',
669                 # These tests crash when run with coverage turned on due to an
670                 # issue with llvm_gcda_increment_indirect_counter:
671                 # http://crbug.com/156058
672                 'debug/trace_event_unittest.cc',
673                 'debug/trace_event_unittest.h',
674                 'logging_unittest.cc',
675                 'string_util_unittest.cc',
676                 'test/trace_event_analyzer_unittest.cc',
677                 'utf_offset_string_conversions_unittest.cc',
678               ],
679             }],
680           ],
681           'actions': [
682             {
683               'action_name': 'copy_test_data',
684               'variables': {
685                 'test_data_files': [
686                   'data/json/bom_feff.json',
687                   'data/file_util_unittest',
688                 ],
689                 'test_data_prefix': 'base',
690               },
691               'includes': [ '../build/copy_test_data_ios.gypi' ],
692             },
693           ],
694         }],
695         ['use_glib==1', {
696           'sources!': [
697             'file_version_info_unittest.cc',
698           ],
699           'conditions': [
700             [ 'linux_use_tcmalloc==1', {
701                 'dependencies': [
702                   'allocator/allocator.gyp:allocator',
703                 ],
704               },
705             ],
706             [ 'toolkit_uses_gtk==1', {
707               'sources': [
708                 'nix/xdg_util_unittest.cc',
709               ],
710               'dependencies': [
711                 '../build/linux/system.gyp:gtk',
712               ]
713             }],
714           ],
715           'dependencies': [
716             '../build/linux/system.gyp:glib',
717             '../build/linux/system.gyp:ssl',
718             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
719           ],
720         }, {  # use_glib!=1
721           'sources!': [
722             'message_pump_glib_unittest.cc',
723           ]
724         }],
725         # This is needed to trigger the dll copy step on windows.
726         # TODO(mark): This should not be necessary.
727         ['OS == "win"', {
728           'dependencies': [
729             '../third_party/icu/icu.gyp:icudata',
730           ],
731           'sources!': [
732             'file_descriptor_shuffle_unittest.cc',
733             'files/dir_reader_posix_unittest.cc',
734             'threading/worker_pool_posix_unittest.cc',
735             'message_pump_libevent_unittest.cc',
736           ],
737           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
738           'msvs_disabled_warnings': [
739             4267,
740           ],
741         }, {  # OS != "win"
742           'dependencies': [
743             '../third_party/libevent/libevent.gyp:libevent'
744           ],
745           'sources/': [
746             ['exclude', '^win/'],
747           ],
748           'sources!': [
749             'debug/trace_event_win_unittest.cc',
750             'time_win_unittest.cc',
751             'win/win_util_unittest.cc',
752           ],
753         }],
754         ['use_system_nspr==1', {
755           'dependencies': [
756             'third_party/nspr/nspr.gyp:nspr',
757           ],
758         }],
759       ],  # conditions
760       'target_conditions': [
761         ['OS == "ios"', {
762           'sources/': [
763             # Pull in specific Mac files for iOS (which have been filtered out
764             # by file name rules).
765             ['include', '^mac/objc_property_releaser_unittest\\.mm$'],
766             ['include', '^mac/bind_objc_block_unittest\\.mm$'],
767             ['include', '^sys_string_conversions_mac_unittest\\.mm$'],
768           ],
769         }],
770       ],  # target_conditions
771     },
772     {
773       'target_name': 'test_support_base',
774       'type': 'static_library',
775       'dependencies': [
776         'base',
777         'base_static',
778         'base_i18n',
779         '../testing/gmock.gyp:gmock',
780         '../testing/gtest.gyp:gtest',
781       ],
782       'export_dependent_settings': [
783         'base',
784       ],
785       'conditions': [
786         ['toolkit_uses_gtk==1', {
787           'dependencies': [
788             # test_suite initializes GTK.
789             '../build/linux/system.gyp:gtk',
790           ],
791         }],
792         ['os_posix==0', {
793           'sources!': [
794             'test/scoped_locale.cc',
795             'test/scoped_locale.h',
796           ],
797         }],
798         ['os_bsd==1', {
799           'sources!': [
800             'test/test_file_util_linux.cc',
801           ],
802         }],
803       ],
804       'sources': [
805         'perftimer.cc',
806         'test/expectations/expectation.cc',
807         'test/expectations/expectation.h',
808         'test/expectations/parser.cc',
809         'test/expectations/parser.h',
810         'test/main_hook.cc',
811         'test/main_hook.h',
812         'test/main_hook_ios.mm',
813         'test/mock_chrome_application_mac.h',
814         'test/mock_chrome_application_mac.mm',
815         'test/mock_devices_changed_observer.cc',
816         'test/mock_devices_changed_observer.h',
817         'test/mock_time_provider.cc',
818         'test/mock_time_provider.h',
819         'test/multiprocess_test.cc',
820         'test/multiprocess_test.h',
821         'test/multiprocess_test_android.cc',
822         'test/null_task_runner.cc',
823         'test/null_task_runner.h',
824         'test/perf_test_suite.cc',
825         'test/perf_test_suite.h',
826         'test/scoped_locale.cc',
827         'test/scoped_locale.h',
828         'test/scoped_path_override.cc',
829         'test/scoped_path_override.h',
830         'test/sequenced_task_runner_test_template.cc',
831         'test/sequenced_task_runner_test_template.h',
832         'test/task_runner_test_template.cc',
833         'test/task_runner_test_template.h',
834         'test/test_file_util.h',
835         'test/test_file_util_linux.cc',
836         'test/test_file_util_mac.cc',
837         'test/test_file_util_posix.cc',
838         'test/test_file_util_win.cc',
839         'test/test_listener_ios.h',
840         'test/test_listener_ios.mm',
841         'test/test_pending_task.cc',
842         'test/test_pending_task.h',
843         'test/test_reg_util_win.cc',
844         'test/test_reg_util_win.h',
845         'test/test_shortcut_win.cc',
846         'test/test_shortcut_win.h',
847         'test/test_simple_task_runner.cc',
848         'test/test_simple_task_runner.h',
849         'test/test_suite.cc',
850         'test/test_suite.h',
851         'test/test_support_android.cc',
852         'test/test_support_android.h',
853         'test/test_support_ios.h',
854         'test/test_support_ios.mm',
855         'test/test_switches.cc',
856         'test/test_switches.h',
857         'test/test_timeouts.cc',
858         'test/test_timeouts.h',
859         'test/thread_test_helper.cc',
860         'test/thread_test_helper.h',
861         'test/trace_event_analyzer.cc',
862         'test/trace_event_analyzer.h',
863         'test/values_test_util.cc',
864         'test/values_test_util.h',
865       ],
866       'target_conditions': [
867         ['OS == "ios"', {
868           'sources/': [
869             # Pull in specific Mac files for iOS (which have been filtered out
870             # by file name rules).
871             ['include', '^test/test_file_util_mac\\.cc$'],
872           ],
873         }],
874       ],  # target_conditions
875     },
876     {
877       'target_name': 'test_support_perf',
878       'type': 'static_library',
879       'dependencies': [
880         'base',
881         '../testing/gtest.gyp:gtest',
882       ],
883       'sources': [
884         'perftimer.cc',
885         'test/run_all_perftests.cc',
886       ],
887       'direct_dependent_settings': {
888         'defines': [
889           'PERF_TEST',
890         ],
891       },
892       'conditions': [
893         ['toolkit_uses_gtk==1', {
894           'dependencies': [
895             # Needed to handle the #include chain:
896             #   base/test/perf_test_suite.h
897             #   base/test/test_suite.h
898             #   gtk/gtk.h
899             '../build/linux/system.gyp:gtk',
900           ],
901         }],
902       ],
903     },
904   ],
905   'conditions': [
906     ['OS!="ios"', {
907       'targets': [
908         {
909           'target_name': 'check_example',
910           'type': 'executable',
911           'sources': [
912             'check_example.cc',
913           ],
914           'dependencies': [
915             'base',
916           ],
917         },
918       ],
919     }],
920     ['OS == "win" and target_arch=="ia32"', {
921       'targets': [
922         {
923           'target_name': 'base_nacl_win64',
924           'type': '<(component)',
925           'variables': {
926             'base_target': 1,
927           },
928           'dependencies': [
929             'base_static_win64',
930             'allocator/allocator.gyp:allocator_extension_thunks_win64',
931             'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
932           ],
933           # TODO(gregoryd): direct_dependent_settings should be shared with the
934           # 32-bit target, but it doesn't work due to a bug in gyp
935           'direct_dependent_settings': {
936             'include_dirs': [
937               '..',
938             ],
939           },
940           'defines': [
941             '<@(nacl_win64_defines)',
942           ],
943           'sources!': [
944             # base64.cc depends on modp_b64.
945             'base64.cc',
946           ],
947           'configurations': {
948             'Common_Base': {
949               'msvs_target_platform': 'x64',
950             },
951           },
952           'conditions': [
953             ['component == "shared_library"', {
954               'sources!': [
955                 'debug/debug_on_start_win.cc',
956               ],
957             }],
958           ],
959         },
960         {
961           'target_name': 'base_i18n_nacl_win64',
962           'type': '<(component)',
963           # TODO(gregoryd): direct_dependent_settings should be shared with the
964           # 32-bit target, but it doesn't work due to a bug in gyp
965           'direct_dependent_settings': {
966             'include_dirs': [
967               '..',
968             ],
969           },
970           'defines': [
971             '<@(nacl_win64_defines)',
972             'BASE_I18N_IMPLEMENTATION',
973           ],
974           'include_dirs': [
975             '..',
976           ],
977           'sources': [
978             'i18n/icu_util_nacl_win64.cc',
979           ],
980           'configurations': {
981             'Common_Base': {
982               'msvs_target_platform': 'x64',
983             },
984           },
985         },
986         {
987           # TODO(rvargas): Remove this when gyp finally supports a clean model.
988           # See bug 36232.
989           'target_name': 'base_static_win64',
990           'type': 'static_library',
991           'sources': [
992             'base_switches.cc',
993             'base_switches.h',
994             'win/pe_image.cc',
995             'win/pe_image.h',
996           ],
997           'sources!': [
998             # base64.cc depends on modp_b64.
999             'base64.cc',
1000           ],
1001           'include_dirs': [
1002             '..',
1003           ],
1004           'configurations': {
1005             'Common_Base': {
1006               'msvs_target_platform': 'x64',
1007             },
1008           },
1009           'defines': [
1010             'NACL_WIN64',
1011           ],
1012           # TODO(rvargas): Bug 78117. Remove this.
1013           'msvs_disabled_warnings': [
1014             4244,
1015           ],
1016         },
1017       ],
1018     }],
1019     ['os_posix==1 and OS!="mac" and OS!="ios"', {
1020       'targets': [
1021         {
1022           'target_name': 'symbolize',
1023           'type': 'static_library',
1024           'toolsets': ['host', 'target'],
1025           'variables': {
1026             'chromium_code': 0,
1027           },
1028           'conditions': [
1029             ['OS == "solaris"', {
1030               'include_dirs': [
1031                 '/usr/gnu/include',
1032                 '/usr/gnu/include/libelf',
1033               ],
1034             },],
1035           ],
1036           'cflags': [
1037             '-Wno-sign-compare',
1038           ],
1039           'cflags!': [
1040             '-Wextra',
1041           ],
1042           'sources': [
1043             'third_party/symbolize/config.h',
1044             'third_party/symbolize/demangle.cc',
1045             'third_party/symbolize/demangle.h',
1046             'third_party/symbolize/glog/logging.h',
1047             'third_party/symbolize/glog/raw_logging.h',
1048             'third_party/symbolize/symbolize.cc',
1049             'third_party/symbolize/symbolize.h',
1050             'third_party/symbolize/utilities.h',
1051           ],
1052           'include_dirs': [
1053             '..',
1054           ],
1055         },
1056         {
1057           'target_name': 'xdg_mime',
1058           'type': 'static_library',
1059           'toolsets': ['host', 'target'],
1060           'variables': {
1061             'chromium_code': 0,
1062           },
1063           'cflags!': [
1064             '-Wextra',
1065           ],
1066           'sources': [
1067             'third_party/xdg_mime/xdgmime.c',
1068             'third_party/xdg_mime/xdgmime.h',
1069             'third_party/xdg_mime/xdgmimealias.c',
1070             'third_party/xdg_mime/xdgmimealias.h',
1071             'third_party/xdg_mime/xdgmimecache.c',
1072             'third_party/xdg_mime/xdgmimecache.h',
1073             'third_party/xdg_mime/xdgmimeglob.c',
1074             'third_party/xdg_mime/xdgmimeglob.h',
1075             'third_party/xdg_mime/xdgmimeicon.c',
1076             'third_party/xdg_mime/xdgmimeicon.h',
1077             'third_party/xdg_mime/xdgmimeint.c',
1078             'third_party/xdg_mime/xdgmimeint.h',
1079             'third_party/xdg_mime/xdgmimemagic.c',
1080             'third_party/xdg_mime/xdgmimemagic.h',
1081             'third_party/xdg_mime/xdgmimeparent.c',
1082             'third_party/xdg_mime/xdgmimeparent.h',
1083           ],
1084         },
1085       ],
1086     }],
1087     ['OS == "android"', {
1088       'targets': [
1089         {
1090           'target_name': 'base_jni_headers',
1091           'type': 'none',
1092           'sources': [
1093             'android/java/src/org/chromium/base/BuildInfo.java',
1094             'android/java/src/org/chromium/base/CpuFeatures.java',
1095             'android/java/src/org/chromium/base/LocaleUtils.java',
1096             'android/java/src/org/chromium/base/PathService.java',
1097             'android/java/src/org/chromium/base/PathUtils.java',
1098             'android/java/src/org/chromium/base/SystemMessageHandler.java',
1099             'android/java/src/org/chromium/base/SystemMonitor.java',
1100             'android/java/src/org/chromium/base/ThreadUtils.java',
1101           ],
1102           'variables': {
1103             'jni_gen_dir': 'base',
1104           },
1105           'includes': [ '../build/jni_generator.gypi' ],
1106         },
1107         {
1108           'target_name': 'base_java',
1109           'type': 'none',
1110           'variables': {
1111             'package_name': 'base',
1112             'java_in_dir': '../base/android/java',
1113           },
1114           'includes': [ '../build/java.gypi' ],
1115         },
1116         {
1117           'target_name': 'base_java_test_support',
1118           'type': 'none',
1119           'dependencies': [
1120             'base_java',
1121           ],
1122           'variables': {
1123             'package_name': 'base_javatests',
1124             'java_in_dir': '../base/test/android/javatests',
1125           },
1126           'includes': [ '../build/java.gypi' ],
1127         },
1128       ],
1129     }],
1130     ['OS == "win"', {
1131       'targets': [
1132         {
1133           'target_name': 'debug_message',
1134           'type': 'executable',
1135           'sources': [
1136             'debug_message.cc',
1137           ],
1138           'msvs_settings': {
1139             'VCLinkerTool': {
1140               'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
1141             },
1142           },
1143         },
1144       ],
1145     }],
1146     # Special target to wrap a gtest_target_type == shared_library
1147     # base_unittests into an android apk for execution.
1148     # TODO(jrg): lib.target comes from _InstallableTargetInstallPath()
1149     # in the gyp make generator.  What is the correct way to extract
1150     # this path from gyp and into 'raw' for input to antfiles?
1151     # Hard-coding in the gypfile seems a poor choice.
1152     ['OS == "android" and gtest_target_type == "shared_library"', {
1153       'targets': [
1154         {
1155           'target_name': 'base_unittests_apk',
1156           'type': 'none',
1157           'dependencies': [
1158             'base_java',
1159             'base_unittests',
1160           ],
1161           'variables': {
1162             'test_suite_name': 'base_unittests',
1163             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)base_unittests<(SHARED_LIB_SUFFIX)',
1164           },
1165           'includes': [ '../build/apk_test.gypi' ],
1166         },
1167       ],
1168     }],
1169     ['test_isolation_mode != "noop"', {
1170       'targets': [
1171         {
1172           'target_name': 'base_unittests_run',
1173           'type': 'none',
1174           'dependencies': [
1175             'base_unittests',
1176           ],
1177           'includes': [
1178             '../build/isolate.gypi',
1179             'base_unittests.isolate',
1180           ],
1181           'sources': [
1182             'base_unittests.isolate',
1183           ],
1184         },
1185       ],
1186     }],
1187   ],