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