WebKit roll 98705:98715
[chromium-blink-merge.git] / base / base.gyp
blob3003ec80de1a85ec5156517dd4881eeaf2954805
1 # Copyright (c) 2011 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_i18n',
16       'type': '<(component)',
17       'dependencies': [
18         'base',
19         'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
20         '../third_party/icu/icu.gyp:icui18n',
21         '../third_party/icu/icu.gyp:icuuc',
22       ],
23       'conditions': [
24         ['toolkit_uses_gtk==1', {
25           'dependencies': [
26             # i18n/rtl.cc uses gtk
27             '../build/linux/system.gyp:gtk',
28           ],
29         }],
30         # TODO(michaelbai): This should be removed once icu supported 
31         ['OS == "android"', {
32           'dependencies!': [
33             '../third_party/icu/icu.gyp:icui18n',
34             '../third_party/icu/icu.gyp:icuuc',
35           ],
36           'sources!': [
37             'i18n/base_i18n_export.h',
38             'i18n/bidi_line_iterator.cc',
39             'i18n/bidi_line_iterator.h',
40             'i18n/break_iterator.cc',
41             'i18n/break_iterator.h',
42             'i18n/char_iterator.cc',
43             'i18n/char_iterator.h',
44             'i18n/case_conversion.cc',
45             'i18n/case_conversion.h',
46             'i18n/file_util_icu.cc',
47             'i18n/file_util_icu.h',
48             'i18n/icu_encoding_detection.cc',
49             'i18n/icu_encoding_detection.h',
50             'i18n/icu_string_conversions.cc',
51             'i18n/icu_string_conversions.h',
52             'i18n/icu_util.cc',
53             'i18n/icu_util.h',
54             'i18n/number_formatting.cc',
55             'i18n/number_formatting.h',
56             'i18n/rtl.cc',
57             'i18n/rtl.h',
58             'i18n/string_search.cc',
59             'i18n/string_search.h',
60             'i18n/time_formatting.cc',
61             'i18n/time_formatting.h',
62           ],
63         }],
64       ],
65       'export_dependent_settings': [
66         'base',
67       ],
68       'defines': [
69         'BASE_I18N_IMPLEMENTATION',
70       ],
71       'sources': [
72         'i18n/base_i18n_export.h',
73         'i18n/bidi_line_iterator.cc',
74         'i18n/bidi_line_iterator.h',
75         'i18n/break_iterator.cc',
76         'i18n/break_iterator.h',
77         'i18n/char_iterator.cc',
78         'i18n/char_iterator.h',
79         'i18n/case_conversion.cc',
80         'i18n/case_conversion.h',
81         'i18n/file_util_icu.cc',
82         'i18n/file_util_icu.h',
83         'i18n/icu_encoding_detection.cc',
84         'i18n/icu_encoding_detection.h',
85         'i18n/icu_string_conversions.cc',
86         'i18n/icu_string_conversions.h',
87         'i18n/icu_util.cc',
88         'i18n/icu_util.h',
89         'i18n/number_formatting.cc',
90         'i18n/number_formatting.h',
91         'i18n/rtl.cc',
92         'i18n/rtl.h',
93         'i18n/string_search.cc',
94         'i18n/string_search.h',
95         'i18n/time_formatting.cc',
96         'i18n/time_formatting.h',
97       ],
98     },
99     {
100       # This is the subset of files from base that should not be used with a
101       # dynamic library. Note that this library cannot depend on base because
102       # base depends on base_static.
103       'target_name': 'base_static',
104       'type': 'static_library',
105       'toolsets': ['host', 'target'],
106       'sources': [
107         'base_switches.cc',
108         'base_switches.h',
109         'win/pe_image.cc',
110         'win/pe_image.h',
111       ],
112       'include_dirs': [
113         '..',
114       ],
115     },
116     {
117       # TODO(rvargas): Remove this when gyp finally supports a clean model.
118       # See bug 36232.
119       'target_name': 'base_static_win64',
120       'type': 'static_library',
121       'sources': [
122         'base_switches.cc',
123         'base_switches.h',
124         'win/pe_image.cc',
125         'win/pe_image.h',
126       ],
127       'include_dirs': [
128         '..',
129       ],
130       'configurations': {
131         'Common_Base': {
132           'msvs_target_platform': 'x64',
133         },
134       },
135       'defines': [
136         'NACL_WIN64',
137       ],
138       # TODO(rvargas): Bug 78117. Remove this.
139       'msvs_disabled_warnings': [
140         4244,
141       ],
142     },
143     {
144       'target_name': 'base_unittests',
145       'type': 'executable',
146       'sources': [
147         # Infrastructure files.
148         'test/run_all_unittests.cc',
150         # Tests.
151         'android/scoped_java_ref_unittest.cc',
152         'at_exit_unittest.cc',
153         'atomicops_unittest.cc',
154         'base64_unittest.cc',
155         'bind_unittest.cc',
156         'bind_unittest.nc',
157         'bits_unittest.cc',
158         'callback_unittest.cc',
159         'callback_unittest.nc',
160         'command_line_unittest.cc',
161         'cpu_unittest.cc',
162         'debug/leak_tracker_unittest.cc',
163         'debug/stack_trace_unittest.cc',
164         'debug/trace_event_unittest.cc',
165         'debug/trace_event_win_unittest.cc',
166         'dir_reader_posix_unittest.cc',
167         'environment_unittest.cc',
168         'file_descriptor_shuffle_unittest.cc',
169         'file_path_unittest.cc',
170         'file_util_unittest.cc',
171         'file_version_info_unittest.cc',
172         'gmock_unittest.cc',
173         'id_map_unittest.cc',
174         'i18n/break_iterator_unittest.cc',
175         'i18n/char_iterator_unittest.cc',
176         'i18n/case_conversion_unittest.cc',
177         'i18n/file_util_icu_unittest.cc',
178         'i18n/icu_string_conversions_unittest.cc',
179         'i18n/number_formatting_unittest.cc',
180         'i18n/rtl_unittest.cc',
181         'i18n/string_search_unittest.cc',
182         'i18n/time_formatting_unittest.cc',
183         'json/json_reader_unittest.cc',
184         'json/json_writer_unittest.cc',
185         'json/string_escape_unittest.cc',
186         'lazy_instance_unittest.cc',
187         'linked_list_unittest.cc',
188         'logging_unittest.cc',
189         'mac/foundation_util_unittest.mm',
190         'mac/mac_util_unittest.mm',
191         'mac/objc_property_releaser_unittest.mm',
192         'md5_unittest.cc',
193         'memory/linked_ptr_unittest.cc',
194         'memory/mru_cache_unittest.cc',
195         'memory/ref_counted_memory_unittest.cc',
196         'memory/ref_counted_unittest.cc',
197         'memory/scoped_ptr_unittest.cc',
198         'memory/scoped_vector_unittest.cc',
199         'memory/singleton_unittest.cc',
200         'memory/weak_ptr_unittest.cc',
201         'message_loop_proxy_impl_unittest.cc',
202         'message_loop_proxy_unittest.cc',
203         'message_loop_unittest.cc',
204         'message_pump_glib_unittest.cc',
205         'message_pump_libevent_unittest.cc',
206         'metrics/field_trial_unittest.cc',
207         'metrics/histogram_unittest.cc',
208         'metrics/stats_table_unittest.cc',
209         'observer_list_unittest.cc',
210         'path_service_unittest.cc',
211         'pickle_unittest.cc',
212         'platform_file_unittest.cc',
213         'pr_time_unittest.cc',
214         'process_util_unittest.cc',
215         'process_util_unittest_mac.h',
216         'process_util_unittest_mac.mm',
217         'rand_util_unittest.cc',
218         'scoped_native_library_unittest.cc',
219         'scoped_temp_dir_unittest.cc',
220         'sha1_unittest.cc',
221         'shared_memory_unittest.cc',
222         'stack_container_unittest.cc',
223         'string16_unittest.cc',
224         'string_number_conversions_unittest.cc',
225         'string_piece_unittest.cc',
226         'string_split_unittest.cc',
227         'string_tokenizer_unittest.cc',
228         'string_util_unittest.cc',
229         'stringize_macros_unittest.cc',
230         'stringprintf_unittest.cc',
231         'synchronization/cancellation_flag_unittest.cc',
232         'synchronization/condition_variable_unittest.cc',
233         'synchronization/lock_unittest.cc',
234         'synchronization/waitable_event_unittest.cc',
235         'synchronization/waitable_event_watcher_unittest.cc',
236         'sys_info_unittest.cc',
237         'sys_string_conversions_mac_unittest.mm',
238         'sys_string_conversions_unittest.cc',
239         'system_monitor/system_monitor_unittest.cc',
240         'task_queue_unittest.cc',
241         'task_unittest.cc',
242         'template_util_unittest.cc',
243         'threading/non_thread_safe_unittest.cc',
244         'threading/platform_thread_unittest.cc',
245         'threading/simple_thread_unittest.cc',
246         'threading/thread_checker_unittest.cc',
247         'threading/thread_collision_warner_unittest.cc',
248         'threading/thread_local_storage_unittest.cc',
249         'threading/thread_local_unittest.cc',
250         'threading/thread_unittest.cc',
251         'threading/watchdog_unittest.cc',
252         'threading/worker_pool_posix_unittest.cc',
253         'threading/worker_pool_unittest.cc',
254         'time_unittest.cc',
255         'time_win_unittest.cc',
256         'timer_unittest.cc',
257         'tools_sanity_unittest.cc',
258         'tracked_objects_unittest.cc',
259         'tuple_unittest.cc',
260         'utf_offset_string_conversions_unittest.cc',
261         'utf_string_conversions_unittest.cc',
262         'values_unittest.cc',
263         'version_unittest.cc',
264         'vlog_unittest.cc',
265         'win/event_trace_consumer_unittest.cc',
266         'win/event_trace_controller_unittest.cc',
267         'win/event_trace_provider_unittest.cc',
268         'win/i18n_unittest.cc',
269         'win/object_watcher_unittest.cc',
270         'win/pe_image_unittest.cc',
271         'win/registry_unittest.cc',
272         'win/scoped_bstr_unittest.cc',
273         'win/scoped_comptr_unittest.cc',
274         'win/scoped_variant_unittest.cc',
275         'win/win_util_unittest.cc',
276         'win/wrapped_window_proc_unittest.cc',
277       ],
278       'dependencies': [
279         'base',
280         'base_i18n',
281         'base_static',
282         'test_support_base',
283         'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
284         '../testing/gmock.gyp:gmock',
285         '../testing/gtest.gyp:gtest',
286         '../third_party/icu/icu.gyp:icui18n',
287         '../third_party/icu/icu.gyp:icuuc',
288       ],
289       'includes': ['../build/nocompile.gypi'],
290       'variables': {
291          # TODO(ajwong): Is there a way to autodetect this?
292         'module_dir': 'base'
293       },
294       'conditions': [
295         ['OS == "android"', {
296           # TODO(michaelbai): This should be removed once icu supported
297           'dependencies!': [
298             '../third_party/icu/icu.gyp:icui18n',
299             '../third_party/icu/icu.gyp:icuuc',
300           ],
301           'sources!': [
302             # TODO(michaelbai): The belows are excluded because of the missing
303             # icu and should be added back once icu is ready.
304             'i18n/break_iterator_unittest.cc',
305             'i18n/char_iterator_unittest.cc',
306             'i18n/case_conversion_unittest.cc',
307             'i18n/file_util_icu_unittest.cc',
308             'i18n/icu_string_conversions_unittest.cc',
309             'i18n/number_formatting_unittest.cc',
310             'i18n/rtl_unittest.cc',
311             'i18n/string_search_unittest.cc',
312             'i18n/time_formatting_unittest.cc',
313             # TODO(michaelbai): Removed the below once the fix upstreamed.
314             'memory/mru_cache_unittest.cc',
315             'process_util_unittest.cc',
316             'synchronization/cancellation_flag_unittest.cc',
317             # TODO(michaelbai): The below files are excluded because of the
318             # missing JNI and should be added back once JNI is ready.
319             'android/scoped_java_ref_unittest.cc',
320             'debug/stack_trace_unittest.cc',
321           ],
322         }],
323         ['use_glib==1', {
324           'sources!': [
325             'file_version_info_unittest.cc',
326           ],
327           'conditions': [
328             [ 'linux_use_tcmalloc==1', {
329                 'dependencies': [
330                   'allocator/allocator.gyp:allocator',
331                 ],
332               },
333             ],
334             ['gcc_version==44', {
335               # Avoid gcc 4.4 strict aliasing issues in stl_tree.h when
336               # building mru_cache_unittest.cc.
337               'cflags': [
338                 '-fno-strict-aliasing',
339               ],
340             }],
341             [ 'toolkit_uses_gtk==1', {
342               'sources': [
343                 'nix/xdg_util_unittest.cc',
344               ],
345               'dependencies': [
346                 '../build/linux/system.gyp:gtk',
347               ]
348             }],
349           ],
350           'dependencies': [
351             '../build/linux/system.gyp:glib',
352             '../build/linux/system.gyp:ssl',
353             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
354           ],
355         }, {  # use_glib!=1
356           'sources!': [
357             'message_pump_glib_unittest.cc',
358           ]
359         }],
360         # This is needed to trigger the dll copy step on windows.
361         # TODO(mark): This should not be necessary.
362         ['OS == "win"', {
363           'dependencies': [
364             '../third_party/icu/icu.gyp:icudata',
365           ],
366           'sources!': [
367             'dir_reader_posix_unittest.cc',
368             'file_descriptor_shuffle_unittest.cc',
369             'threading/worker_pool_posix_unittest.cc',
370             'message_pump_libevent_unittest.cc',
371           ],
372         }, {  # OS != "win"
373           'dependencies': [
374             '../third_party/libevent/libevent.gyp:libevent'
375           ],
376           'sources/': [
377             ['exclude', '^win/'],
378           ],
379           'sources!': [
380             'debug/trace_event_win_unittest.cc',
381             'time_win_unittest.cc',
382             'win/win_util_unittest.cc',
383           ],
384         }],
385       ],
386     },
387     {
388       'target_name': 'test_support_base',
389       'type': 'static_library',
390       'dependencies': [
391         'base',
392         'base_static',
393         'base_i18n',
394         '../testing/gmock.gyp:gmock',
395         '../testing/gtest.gyp:gtest',
396       ],
397       'export_dependent_settings': [
398         'base',
399       ],
400       'conditions': [
401         ['toolkit_uses_gtk==1', {
402           'dependencies': [
403             # test_suite initializes GTK.
404             '../build/linux/system.gyp:gtk',
405           ],
406         }],
407         ['os_posix==0', {
408           'sources!': [
409             'test/scoped_locale.cc',
410             'test/scoped_locale.h',
411           ],
412         }],
413         ['OS=="openbsd"', {
414           'sources!': [
415             'test/test_file_util_linux.cc',
416           ],
417         }],
418       ],
419       'sources': [
420         'perftimer.cc',
421         'test/mock_chrome_application_mac.h',
422         'test/mock_chrome_application_mac.mm',
423         'test/mock_time_provider.cc',
424         'test/mock_time_provider.h',
425         'test/multiprocess_test.cc',
426         'test/multiprocess_test.h',
427         'test/perf_test_suite.cc',
428         'test/perf_test_suite.h',
429         'test/scoped_locale.cc',
430         'test/scoped_locale.h',
431         'test/test_file_util.h',
432         'test/test_file_util_linux.cc',
433         'test/test_file_util_mac.cc',
434         'test/test_file_util_posix.cc',
435         'test/test_file_util_win.cc',
436         'test/test_reg_util_win.cc',
437         'test/test_reg_util_win.h',
438         'test/test_suite.cc',
439         'test/test_suite.h',
440         'test/test_stub_android.cc',
441         'test/test_switches.cc',
442         'test/test_switches.h',
443         'test/test_timeouts.cc',
444         'test/test_timeouts.h',
445         'test/thread_test_helper.cc',
446         'test/thread_test_helper.h',
447       ],
448     },
449     {
450       'target_name': 'test_support_perf',
451       'type': 'static_library',
452       'dependencies': [
453         'base',
454         '../testing/gtest.gyp:gtest',
455       ],
456       'sources': [
457         'perftimer.cc',
458         'test/run_all_perftests.cc',
459       ],
460       'direct_dependent_settings': {
461         'defines': [
462           'PERF_TEST',
463         ],
464       },
465       'conditions': [
466         ['toolkit_uses_gtk==1', {
467           'dependencies': [
468             # Needed to handle the #include chain:
469             #   base/test/perf_test_suite.h
470             #   base/test/test_suite.h
471             #   gtk/gtk.h
472             '../build/linux/system.gyp:gtk',
473           ],
474         }],
475       ],
476     },
477   ],
478   'conditions': [
479     [ 'OS == "win"', {
480       'targets': [
481         {
482           'target_name': 'debug_message',
483           'type': 'executable',
484           'sources': [
485             'debug_message.cc',
486           ],
487           'msvs_settings': {
488             'VCLinkerTool': {
489               'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
490             },
491           },
492         },
493       ],
494     }],
495   ],