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