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