• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4
5{
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_debugging_flags#target',
25        'base_static',
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        ['desktop_linux == 1 or chromeos == 1', {
39          'conditions': [
40            ['chromeos==1', {
41              'sources/': [ ['include', '_chromeos\\.cc$'] ]
42            }],
43          ],
44          'dependencies': [
45            'symbolize',
46            'xdg_mime',
47          ],
48          'defines': [
49            'USE_SYMBOLIZE',
50          ],
51        }, {  # desktop_linux == 0 and chromeos == 0
52            'sources/': [
53              ['exclude', '/xdg_user_dirs/'],
54              ['exclude', '_nss\\.cc$'],
55            ],
56        }],
57        ['use_glib==1', {
58          'dependencies': [
59            '../build/linux/system.gyp:glib',
60          ],
61          'export_dependent_settings': [
62            '../build/linux/system.gyp:glib',
63          ],
64        }],
65        ['OS == "android" and _toolset == "host"', {
66          # Always build base as a static_library for host toolset, even if
67          # we're doing a component build. Specifically, we only care about the
68          # target toolset using components since that's what developers are
69          # focusing on. In theory we should do this more generally for all
70          # targets when building for host, but getting the gyp magic
71          # per-toolset for the "component" variable is hard, and we really only
72          # need base on host.
73          'type': 'static_library',
74          # Base for host support is the minimum required to run the
75          # ssl false start blacklist tool. It requires further changes
76          # to generically support host builds (and tests).
77          # Note: when building for host, gyp has OS == "android",
78          # hence the *_android.cc files are included but the actual code
79          # doesn't have OS_ANDROID / ANDROID defined.
80          'conditions': [
81            ['host_os == "mac"', {
82              'sources/': [
83                ['exclude', '^native_library_linux\\.cc$'],
84                ['exclude', '^process_util_linux\\.cc$'],
85                ['exclude', '^sys_info_linux\\.cc$'],
86                ['exclude', '^sys_string_conversions_linux\\.cc$'],
87                ['exclude', '^worker_pool_linux\\.cc$'],
88              ],
89            }],
90          ],
91        }],
92        ['OS == "android" and _toolset == "target"', {
93          'dependencies': [
94            'base_java',
95            'base_jni_headers',
96            '../build/android/ndk.gyp:cpu_features',
97            '../third_party/ashmem/ashmem.gyp:ashmem',
98          ],
99          'link_settings': {
100            'libraries': [
101              '-llog',
102            ],
103          },
104          'sources!': [
105            'debug/stack_trace_posix.cc',
106          ],
107        }],
108        ['os_bsd==1', {
109          'include_dirs': [
110            '/usr/local/include',
111          ],
112          'link_settings': {
113            'libraries': [
114              '-L/usr/local/lib -lexecinfo',
115            ],
116          },
117        }],
118        ['OS == "linux"', {
119          'link_settings': {
120            'libraries': [
121              # We need rt for clock_gettime().
122              '-lrt',
123              # For 'native_library_linux.cc'
124              '-ldl',
125            ],
126          },
127          'conditions': [
128            ['use_allocator!="tcmalloc"', {
129              'defines': [
130                'NO_TCMALLOC',
131              ],
132              'direct_dependent_settings': {
133                'defines': [
134                  'NO_TCMALLOC',
135                ],
136              },
137            }],
138          ],
139        }],
140        ['OS == "win"', {
141          # Specify delayload for base.dll.
142          'msvs_settings': {
143            'VCLinkerTool': {
144              'DelayLoadDLLs': [
145                'cfgmgr32.dll',
146                'powrprof.dll',
147                'setupapi.dll',
148              ],
149              'AdditionalDependencies': [
150                'cfgmgr32.lib',
151                'powrprof.lib',
152                'setupapi.lib',
153              ],
154            },
155          },
156          # Specify delayload for components that link with base.lib.
157          'all_dependent_settings': {
158            'msvs_settings': {
159              'VCLinkerTool': {
160                'DelayLoadDLLs': [
161                  'cfgmgr32.dll',
162                  'powrprof.dll',
163                  'setupapi.dll',
164                ],
165                'AdditionalDependencies': [
166                  'cfgmgr32.lib',
167                  'powrprof.lib',
168                  'setupapi.lib',
169                ],
170              },
171            },
172          },
173          'copies': [
174            {
175              'destination': '<(PRODUCT_DIR)/',
176              'files': [
177                '../build/win/dbghelp_xp/dbghelp.dll',
178              ],
179            },
180          ],
181          'dependencies': [
182           'trace_event/etw_manifest/etw_manifest.gyp:etw_manifest',
183          ],
184        }],
185        ['OS == "mac" or (OS == "ios" and _toolset == "host")', {
186          'link_settings': {
187            'libraries': [
188              '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
189              '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework',
190              '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
191              '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
192              '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
193              '$(SDKROOT)/System/Library/Frameworks/IOKit.framework',
194              '$(SDKROOT)/System/Library/Frameworks/Security.framework',
195            ],
196          },
197        }],
198        ['OS == "ios" and _toolset != "host"', {
199          'link_settings': {
200            'libraries': [
201              '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
202              '$(SDKROOT)/System/Library/Frameworks/CoreGraphics.framework',
203              '$(SDKROOT)/System/Library/Frameworks/CoreText.framework',
204              '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
205              '$(SDKROOT)/System/Library/Frameworks/UIKit.framework',
206            ],
207          },
208        }],
209        ['OS != "win" and (OS != "ios" or _toolset == "host")', {
210            'dependencies': ['third_party/libevent/libevent.gyp:libevent'],
211        },],
212        ['component=="shared_library"', {
213          'conditions': [
214            ['OS=="win"', {
215              'sources!': [
216                'debug/debug_on_start_win.cc',
217              ],
218            }],
219          ],
220        }],
221        ['OS=="ios"', {
222          'sources!': [
223            'sync_socket.h',
224            'sync_socket_posix.cc',
225          ]
226        }],
227      ],
228      'sources': [
229        'auto_reset.h',
230        'linux_util.cc',
231        'linux_util.h',
232        'message_loop/message_pump_android.cc',
233        'message_loop/message_pump_android.h',
234        'message_loop/message_pump_glib.cc',
235        'message_loop/message_pump_glib.h',
236        'message_loop/message_pump_io_ios.cc',
237        'message_loop/message_pump_io_ios.h',
238        'message_loop/message_pump_libevent.cc',
239        'message_loop/message_pump_libevent.h',
240        'message_loop/message_pump_mac.h',
241        'message_loop/message_pump_mac.mm',
242        'metrics/field_trial.cc',
243        'metrics/field_trial.h',
244        'posix/file_descriptor_shuffle.cc',
245        'posix/file_descriptor_shuffle.h',
246        'sync_socket.h',
247        'sync_socket_posix.cc',
248        'sync_socket_win.cc',
249        'third_party/xdg_user_dirs/xdg_user_dir_lookup.cc',
250        'third_party/xdg_user_dirs/xdg_user_dir_lookup.h',
251      ],
252      'includes': [
253        '../build/android/increase_size_for_speed.gypi',
254      ],
255    },
256    {
257      'target_name': 'base_i18n',
258      'type': '<(component)',
259      'variables': {
260        'enable_wexit_time_destructors': 1,
261        'optimize': 'max',
262        'base_i18n_target': 1,
263      },
264      'dependencies': [
265        'base',
266        'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
267        '../third_party/icu/icu.gyp:icui18n',
268        '../third_party/icu/icu.gyp:icuuc',
269      ],
270      'conditions': [
271        ['OS == "win"', {
272          # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
273          'msvs_disabled_warnings': [
274            4267,
275          ],
276        }],
277        ['icu_use_data_file_flag==1', {
278          'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'],
279        }, { # else icu_use_data_file_flag !=1
280          'conditions': [
281            ['OS=="win"', {
282              'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED'],
283            }, {
284              'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC'],
285            }],
286          ],
287        }],
288        ['OS == "ios"', {
289          'toolsets': ['host', 'target'],
290        }],
291      ],
292      'export_dependent_settings': [
293        'base',
294        '../third_party/icu/icu.gyp:icuuc',
295        '../third_party/icu/icu.gyp:icui18n',
296      ],
297      'includes': [
298        '../build/android/increase_size_for_speed.gypi',
299      ],
300    },
301    {
302      'target_name': 'base_message_loop_tests',
303      'type': 'static_library',
304      'dependencies': [
305        'base',
306        '../testing/gtest.gyp:gtest',
307      ],
308      'sources': [
309        'message_loop/message_loop_test.cc',
310        'message_loop/message_loop_test.h',
311      ],
312    },
313    {
314      'target_name': 'base_prefs',
315      'type': '<(component)',
316      'variables': {
317        'enable_wexit_time_destructors': 1,
318        'optimize': 'max',
319      },
320      'dependencies': [
321        'base',
322      ],
323      'export_dependent_settings': [
324        'base',
325      ],
326      'defines': [
327        'BASE_PREFS_IMPLEMENTATION',
328      ],
329      'sources': [
330        'prefs/base_prefs_export.h',
331        'prefs/default_pref_store.cc',
332        'prefs/default_pref_store.h',
333        'prefs/json_pref_store.cc',
334        'prefs/json_pref_store.h',
335        'prefs/overlay_user_pref_store.cc',
336        'prefs/overlay_user_pref_store.h',
337        'prefs/persistent_pref_store.h',
338        'prefs/pref_change_registrar.cc',
339        'prefs/pref_change_registrar.h',
340        'prefs/pref_filter.h',
341        'prefs/pref_member.cc',
342        'prefs/pref_member.h',
343        'prefs/pref_notifier.h',
344        'prefs/pref_notifier_impl.cc',
345        'prefs/pref_notifier_impl.h',
346        'prefs/pref_observer.h',
347        'prefs/pref_registry.cc',
348        'prefs/pref_registry.h',
349        'prefs/pref_registry_simple.cc',
350        'prefs/pref_registry_simple.h',
351        'prefs/pref_service.cc',
352        'prefs/pref_service.h',
353        'prefs/pref_service_factory.cc',
354        'prefs/pref_service_factory.h',
355        'prefs/pref_store.cc',
356        'prefs/pref_store.h',
357        'prefs/pref_value_map.cc',
358        'prefs/pref_value_map.h',
359        'prefs/pref_value_store.cc',
360        'prefs/pref_value_store.h',
361        'prefs/scoped_user_pref_update.cc',
362        'prefs/scoped_user_pref_update.h',
363        'prefs/value_map_pref_store.cc',
364        'prefs/value_map_pref_store.h',
365        'prefs/writeable_pref_store.h',
366      ],
367      'includes': [
368        '../build/android/increase_size_for_speed.gypi',
369      ],
370    },
371    {
372      'target_name': 'base_prefs_test_support',
373      'type': 'static_library',
374      'dependencies': [
375        'base',
376        'base_prefs',
377        '../testing/gmock.gyp:gmock',
378      ],
379      'sources': [
380        'prefs/mock_pref_change_callback.cc',
381        'prefs/pref_store_observer_mock.cc',
382        'prefs/pref_store_observer_mock.h',
383        'prefs/testing_pref_service.cc',
384        'prefs/testing_pref_service.h',
385        'prefs/testing_pref_store.cc',
386        'prefs/testing_pref_store.h',
387      ],
388    },
389    {
390      # This is the subset of files from base that should not be used with a
391      # dynamic library. Note that this library cannot depend on base because
392      # base depends on base_static.
393      'target_name': 'base_static',
394      'type': 'static_library',
395      'variables': {
396        'enable_wexit_time_destructors': 1,
397        'optimize': 'max',
398      },
399      'toolsets': ['host', 'target'],
400      'sources': [
401        'base_switches.cc',
402        'base_switches.h',
403        'win/pe_image.cc',
404        'win/pe_image.h',
405      ],
406      'include_dirs': [
407        '..',
408      ],
409      'includes': [
410        '../build/android/increase_size_for_speed.gypi',
411      ],
412    },
413    # Include this target for a main() function that simply instantiates
414    # and runs a base::TestSuite.
415    {
416      'target_name': 'run_all_unittests',
417      'type': 'static_library',
418      'dependencies': [
419        'test_support_base',
420      ],
421      'sources': [
422        'test/run_all_unittests.cc',
423      ],
424    },
425    {
426      'target_name': 'base_unittests',
427      'type': '<(gtest_target_type)',
428      'sources': [
429        'allocator/tcmalloc_unittest.cc',
430        'android/application_status_listener_unittest.cc',
431        'android/content_uri_utils_unittest.cc',
432        'android/jni_android_unittest.cc',
433        'android/jni_array_unittest.cc',
434        'android/jni_string_unittest.cc',
435        'android/library_loader/library_prefetcher_unittest.cc',
436        'android/path_utils_unittest.cc',
437        'android/scoped_java_ref_unittest.cc',
438        'android/sys_utils_unittest.cc',
439        'at_exit_unittest.cc',
440        'atomicops_unittest.cc',
441        'barrier_closure_unittest.cc',
442        'base64_unittest.cc',
443        'base64url_unittest.cc',
444        'big_endian_unittest.cc',
445        'bind_unittest.cc',
446        'bind_unittest.nc',
447        'bits_unittest.cc',
448        'build_time_unittest.cc',
449        'callback_helpers_unittest.cc',
450        'callback_list_unittest.cc',
451        'callback_list_unittest.nc',
452        'callback_unittest.cc',
453        'callback_unittest.nc',
454        'cancelable_callback_unittest.cc',
455        'command_line_unittest.cc',
456        'containers/adapters_unittest.cc',
457        'containers/hash_tables_unittest.cc',
458        'containers/linked_list_unittest.cc',
459        'containers/mru_cache_unittest.cc',
460        'containers/scoped_ptr_hash_map_unittest.cc',
461        'containers/small_map_unittest.cc',
462        'containers/stack_container_unittest.cc',
463        'cpu_unittest.cc',
464        'debug/crash_logging_unittest.cc',
465        'debug/debugger_unittest.cc',
466        'debug/leak_tracker_unittest.cc',
467        'debug/proc_maps_linux_unittest.cc',
468        'debug/stack_trace_unittest.cc',
469        'debug/task_annotator_unittest.cc',
470        'deferred_sequenced_task_runner_unittest.cc',
471        'environment_unittest.cc',
472        'feature_list_unittest.cc',
473        'file_version_info_unittest.cc',
474        'files/dir_reader_posix_unittest.cc',
475        'files/file_locking_unittest.cc',
476        'files/file_path_unittest.cc',
477        'files/file_path_watcher_unittest.cc',
478        'files/file_proxy_unittest.cc',
479        'files/file_unittest.cc',
480        'files/file_util_proxy_unittest.cc',
481        'files/file_util_unittest.cc',
482        'files/important_file_writer_unittest.cc',
483        'files/memory_mapped_file_unittest.cc',
484        'files/scoped_temp_dir_unittest.cc',
485        'gmock_unittest.cc',
486        'guid_unittest.cc',
487        'hash_unittest.cc',
488        'i18n/break_iterator_unittest.cc',
489        'i18n/case_conversion_unittest.cc',
490        'i18n/char_iterator_unittest.cc',
491        'i18n/file_util_icu_unittest.cc',
492        'i18n/icu_string_conversions_unittest.cc',
493        'i18n/message_formatter_unittest.cc',
494        'i18n/number_formatting_unittest.cc',
495        'i18n/rtl_unittest.cc',
496        'i18n/streaming_utf8_validator_unittest.cc',
497        'i18n/string_search_unittest.cc',
498        'i18n/time_formatting_unittest.cc',
499        'i18n/timezone_unittest.cc',
500        'id_map_unittest.cc',
501        'ios/crb_protocol_observers_unittest.mm',
502        'ios/device_util_unittest.mm',
503        'ios/weak_nsobject_unittest.mm',
504        'json/json_parser_unittest.cc',
505        'json/json_reader_unittest.cc',
506        'json/json_value_converter_unittest.cc',
507        'json/json_value_serializer_unittest.cc',
508        'json/json_writer_unittest.cc',
509        'json/string_escape_unittest.cc',
510        'lazy_instance_unittest.cc',
511        'logging_unittest.cc',
512        'mac/bind_objc_block_unittest.mm',
513        'mac/call_with_eh_frame_unittest.mm',
514        'mac/dispatch_source_mach_unittest.cc',
515        'mac/foundation_util_unittest.mm',
516        'mac/libdispatch_task_runner_unittest.cc',
517        'mac/mac_util_unittest.mm',
518        'mac/objc_property_releaser_unittest.mm',
519        'mac/scoped_nsobject_unittest.mm',
520        'mac/scoped_objc_class_swizzler_unittest.mm',
521        'mac/scoped_sending_event_unittest.mm',
522        'md5_unittest.cc',
523        'memory/aligned_memory_unittest.cc',
524        'memory/discardable_shared_memory_unittest.cc',
525        'memory/linked_ptr_unittest.cc',
526        'memory/memory_pressure_listener_unittest.cc',
527        'memory/memory_pressure_monitor_chromeos_unittest.cc',
528        'memory/memory_pressure_monitor_mac_unittest.cc',
529        'memory/memory_pressure_monitor_win_unittest.cc',
530        'memory/ptr_util_unittest.cc',
531        'memory/ref_counted_memory_unittest.cc',
532        'memory/ref_counted_unittest.cc',
533        'memory/scoped_ptr_unittest.cc',
534        'memory/scoped_ptr_unittest.nc',
535        'memory/scoped_vector_unittest.cc',
536        'memory/shared_memory_unittest.cc',
537        'memory/shared_memory_mac_unittest.cc',
538        'memory/singleton_unittest.cc',
539        'memory/weak_ptr_unittest.cc',
540        'memory/weak_ptr_unittest.nc',
541        'message_loop/message_loop_task_runner_unittest.cc',
542        'message_loop/message_loop_unittest.cc',
543        'message_loop/message_pump_glib_unittest.cc',
544        'message_loop/message_pump_io_ios_unittest.cc',
545        'message_loop/message_pump_libevent_unittest.cc',
546        'metrics/bucket_ranges_unittest.cc',
547        'metrics/field_trial_unittest.cc',
548        'metrics/histogram_base_unittest.cc',
549        'metrics/histogram_delta_serialization_unittest.cc',
550        'metrics/histogram_macros_unittest.cc',
551        'metrics/histogram_snapshot_manager_unittest.cc',
552        'metrics/histogram_unittest.cc',
553        'metrics/metrics_hashes_unittest.cc',
554        'metrics/sample_map_unittest.cc',
555        'metrics/sample_vector_unittest.cc',
556        'metrics/sparse_histogram_unittest.cc',
557        'metrics/statistics_recorder_unittest.cc',
558        'native_library_unittest.cc',
559        'numerics/safe_numerics_unittest.cc',
560        'observer_list_unittest.cc',
561        'os_compat_android_unittest.cc',
562        'path_service_unittest.cc',
563        'pickle_unittest.cc',
564        'posix/file_descriptor_shuffle_unittest.cc',
565        'posix/unix_domain_socket_linux_unittest.cc',
566        'power_monitor/power_monitor_unittest.cc',
567        'prefs/default_pref_store_unittest.cc',
568        'prefs/json_pref_store_unittest.cc',
569        'prefs/mock_pref_change_callback.h',
570        'prefs/overlay_user_pref_store_unittest.cc',
571        'prefs/pref_change_registrar_unittest.cc',
572        'prefs/pref_member_unittest.cc',
573        'prefs/pref_notifier_impl_unittest.cc',
574        'prefs/pref_service_unittest.cc',
575        'prefs/pref_value_map_unittest.cc',
576        'prefs/pref_value_store_unittest.cc',
577        'prefs/scoped_user_pref_update_unittest.cc',
578        'process/memory_unittest.cc',
579        'process/memory_unittest_mac.h',
580        'process/memory_unittest_mac.mm',
581        'process/process_metrics_unittest.cc',
582        'process/process_metrics_unittest_ios.cc',
583        'process/process_unittest.cc',
584        'process/process_util_unittest.cc',
585        'profiler/stack_sampling_profiler_unittest.cc',
586        'profiler/tracked_time_unittest.cc',
587        'rand_util_unittest.cc',
588        'scoped_clear_errno_unittest.cc',
589        'scoped_generic_unittest.cc',
590        'scoped_native_library_unittest.cc',
591        'security_unittest.cc',
592        'sequence_checker_unittest.cc',
593        'sha1_unittest.cc',
594        'stl_util_unittest.cc',
595        'strings/nullable_string16_unittest.cc',
596        'strings/pattern_unittest.cc',
597        'strings/safe_sprintf_unittest.cc',
598        'strings/string16_unittest.cc',
599        'strings/string_number_conversions_unittest.cc',
600        'strings/string_piece_unittest.cc',
601        'strings/string_split_unittest.cc',
602        'strings/string_tokenizer_unittest.cc',
603        'strings/string_util_unittest.cc',
604        'strings/stringize_macros_unittest.cc',
605        'strings/stringprintf_unittest.cc',
606        'strings/sys_string_conversions_mac_unittest.mm',
607        'strings/sys_string_conversions_unittest.cc',
608        'strings/utf_offset_string_conversions_unittest.cc',
609        'strings/utf_string_conversions_unittest.cc',
610        'supports_user_data_unittest.cc',
611        'sync_socket_unittest.cc',
612        'synchronization/cancellation_flag_unittest.cc',
613        'synchronization/condition_variable_unittest.cc',
614        'synchronization/lock_unittest.cc',
615        'synchronization/waitable_event_unittest.cc',
616        'synchronization/waitable_event_watcher_unittest.cc',
617        'sys_info_unittest.cc',
618        'system_monitor/system_monitor_unittest.cc',
619        'task/cancelable_task_tracker_unittest.cc',
620        'task_runner_util_unittest.cc',
621        'template_util_unittest.cc',
622        'test/histogram_tester_unittest.cc',
623        'test/test_pending_task_unittest.cc',
624        'test/test_reg_util_win_unittest.cc',
625        'test/trace_event_analyzer_unittest.cc',
626        'test/user_action_tester_unittest.cc',
627        'threading/non_thread_safe_unittest.cc',
628        'threading/platform_thread_unittest.cc',
629        'threading/sequenced_worker_pool_unittest.cc',
630        'threading/sequenced_task_runner_handle_unittest.cc',
631        'threading/simple_thread_unittest.cc',
632        'threading/thread_checker_unittest.cc',
633        'threading/thread_collision_warner_unittest.cc',
634        'threading/thread_id_name_manager_unittest.cc',
635        'threading/thread_local_storage_unittest.cc',
636        'threading/thread_local_unittest.cc',
637        'threading/thread_unittest.cc',
638        'threading/watchdog_unittest.cc',
639        'threading/worker_pool_posix_unittest.cc',
640        'threading/worker_pool_unittest.cc',
641        'time/pr_time_unittest.cc',
642        'time/time_unittest.cc',
643        'time/time_win_unittest.cc',
644        'timer/hi_res_timer_manager_unittest.cc',
645        'timer/mock_timer_unittest.cc',
646        'timer/timer_unittest.cc',
647        'tools_sanity_unittest.cc',
648        'tracked_objects_unittest.cc',
649        'tuple_unittest.cc',
650        'values_unittest.cc',
651        'version_unittest.cc',
652        'vlog_unittest.cc',
653        'win/dllmain.cc',
654        'win/enum_variant_unittest.cc',
655        'win/event_trace_consumer_unittest.cc',
656        'win/event_trace_controller_unittest.cc',
657        'win/event_trace_provider_unittest.cc',
658        'win/i18n_unittest.cc',
659        'win/iunknown_impl_unittest.cc',
660        'win/message_window_unittest.cc',
661        'win/object_watcher_unittest.cc',
662        'win/pe_image_unittest.cc',
663        'win/registry_unittest.cc',
664        'win/scoped_bstr_unittest.cc',
665        'win/scoped_comptr_unittest.cc',
666        'win/scoped_handle_unittest.cc',
667        'win/scoped_process_information_unittest.cc',
668        'win/scoped_variant_unittest.cc',
669        'win/shortcut_unittest.cc',
670        'win/startup_information_unittest.cc',
671        'win/win_util_unittest.cc',
672        'win/wrapped_window_proc_unittest.cc',
673        '<@(trace_event_test_sources)',
674      ],
675      'dependencies': [
676        'base',
677        'base_i18n',
678        'base_message_loop_tests',
679        'base_prefs',
680        'base_prefs_test_support',
681        'base_static',
682        'run_all_unittests',
683        'test_support_base',
684        'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
685        '../testing/gmock.gyp:gmock',
686        '../testing/gtest.gyp:gtest',
687        '../third_party/icu/icu.gyp:icui18n',
688        '../third_party/icu/icu.gyp:icuuc',
689      ],
690      'includes': ['../build/nocompile.gypi'],
691      'variables': {
692         # TODO(ajwong): Is there a way to autodetect this?
693        'module_dir': 'base'
694      },
695      'conditions': [
696        ['OS == "android"', {
697          'dependencies': [
698            'android/jni_generator/jni_generator.gyp:jni_generator_tests',
699            '../testing/android/native_test.gyp:native_test_native_code',
700          ],
701        }],
702        ['OS == "ios" and _toolset != "host"', {
703          'sources/': [
704            # This test needs multiple processes.
705            ['exclude', '^files/file_locking_unittest\\.cc$'],
706            # iOS does not support FilePathWatcher.
707            ['exclude', '^files/file_path_watcher_unittest\\.cc$'],
708            # Only test the iOS-meaningful portion of memory and process_utils.
709            ['exclude', '^memory/discardable_shared_memory_unittest\\.cc$'],
710            ['exclude', '^memory/shared_memory_unittest\\.cc$'],
711            ['exclude', '^process/memory_unittest'],
712            ['exclude', '^process/process_unittest\\.cc$'],
713            ['exclude', '^process/process_util_unittest\\.cc$'],
714            ['include', '^process/process_util_unittest_ios\\.cc$'],
715            # iOS does not use message_pump_libevent.
716            ['exclude', '^message_loop/message_pump_libevent_unittest\\.cc$'],
717          ],
718          'actions': [
719            {
720              'action_name': 'copy_test_data',
721              'variables': {
722                'test_data_files': [
723                  'test/data',
724                ],
725                'test_data_prefix': 'base',
726              },
727              'includes': [ '../build/copy_test_data_ios.gypi' ],
728            },
729          ],
730        }],
731        ['desktop_linux == 1 or chromeos == 1', {
732          'defines': [
733            'USE_SYMBOLIZE',
734          ],
735          'sources!': [
736            'file_version_info_unittest.cc',
737          ],
738          'conditions': [
739            [ 'desktop_linux==1', {
740              'sources': [
741                'nix/xdg_util_unittest.cc',
742              ],
743            }],
744          ],
745        }],
746        ['use_glib == 1', {
747          'dependencies': [
748            '../build/linux/system.gyp:glib',
749          ],
750        }, {  # use_glib == 0
751          'sources!': [
752            'message_loop/message_pump_glib_unittest.cc',
753          ]
754        }],
755        ['use_ozone == 1', {
756          'sources!': [
757            'message_loop/message_pump_glib_unittest.cc',
758          ]
759        }],
760        ['OS == "linux"', {
761          'dependencies': [
762            'malloc_wrapper',
763          ],
764          'conditions': [
765            ['use_allocator!="none"', {
766              'dependencies': [
767                'allocator/allocator.gyp:allocator',
768              ],
769            }],
770          ]},
771        ],
772        [ 'OS == "win" and target_arch == "x64"', {
773          'sources': [
774            'profiler/win32_stack_frame_unwinder_unittest.cc',
775          ],
776          'dependencies': [
777            'base_profiler_test_support_library',
778          ],
779        }],
780        ['OS == "win"', {
781          'sources!': [
782            'file_descriptor_shuffle_unittest.cc',
783            'files/dir_reader_posix_unittest.cc',
784            'message_loop/message_pump_libevent_unittest.cc',
785            'threading/worker_pool_posix_unittest.cc',
786          ],
787          # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
788          'msvs_disabled_warnings': [
789            4267,
790          ],
791          'conditions': [
792            # This is needed so base_unittests uses the allocator shim, as
793            # SecurityTest.MemoryAllocationRestriction* tests are dependent
794            # on tcmalloc.
795            # TODO(wfh): crbug.com/246278 Move tcmalloc specific tests into
796            # their own test suite.
797            ['win_use_allocator_shim==1', {
798              'dependencies': [
799                'allocator/allocator.gyp:allocator',
800              ],
801            }],
802            ['icu_use_data_file_flag==0', {
803              # This is needed to trigger the dll copy step on windows.
804              # TODO(mark): This should not be necessary.
805              'dependencies': [
806                '../third_party/icu/icu.gyp:icudata',
807              ],
808            }],
809          ],
810        }, {  # OS != "win"
811          'dependencies': [
812            'third_party/libevent/libevent.gyp:libevent'
813          ],
814        }],
815      ],  # conditions
816      'target_conditions': [
817        ['OS == "ios" and _toolset != "host"', {
818          'sources/': [
819            # Pull in specific Mac files for iOS (which have been filtered out
820            # by file name rules).
821            ['include', '^mac/bind_objc_block_unittest\\.mm$'],
822            ['include', '^mac/foundation_util_unittest\\.mm$',],
823            ['include', '^mac/objc_property_releaser_unittest\\.mm$'],
824            ['include', '^mac/scoped_nsobject_unittest\\.mm$'],
825            ['include', '^sys_string_conversions_mac_unittest\\.mm$'],
826          ],
827        }],
828        ['OS == "android"', {
829          'sources/': [
830            ['include', '^debug/proc_maps_linux_unittest\\.cc$'],
831          ],
832        }],
833        # Enable more direct string conversions on platforms with native utf8
834        # strings
835        ['OS=="mac" or OS=="ios" or <(chromeos)==1 or <(chromecast)==1', {
836          'defines': ['SYSTEM_NATIVE_UTF8'],
837        }],
838        # SyncSocket isn't used on iOS
839        ['OS=="ios"', {
840          'sources!': [
841            'sync_socket_unittest.cc',
842          ],
843        }],
844      ],  # target_conditions
845    },
846    {
847      # GN: //base:base_perftests
848      'target_name': 'base_perftests',
849      'type': '<(gtest_target_type)',
850      'dependencies': [
851        'base',
852        'test_support_base',
853        '../testing/gtest.gyp:gtest',
854      ],
855      'sources': [
856        'message_loop/message_pump_perftest.cc',
857        'test/run_all_unittests.cc',
858        'threading/thread_perftest.cc',
859        '../testing/perf/perf_test.cc'
860      ],
861      'conditions': [
862        ['OS == "android"', {
863          'dependencies': [
864            '../testing/android/native_test.gyp:native_test_native_code',
865          ],
866        }],
867      ],
868    },
869    {
870      # GN: //base:base_i18n_perftests
871      'target_name': 'base_i18n_perftests',
872      'type': '<(gtest_target_type)',
873      'dependencies': [
874        'test_support_base',
875        'test_support_perf',
876        '../testing/gtest.gyp:gtest',
877        'base_i18n',
878        'base',
879      ],
880      'sources': [
881        'i18n/streaming_utf8_validator_perftest.cc',
882      ],
883    },
884    {
885      # GN: //base/test:test_support
886      'target_name': 'test_support_base',
887      'type': 'static_library',
888      'dependencies': [
889        'base',
890        'base_static',
891        'base_i18n',
892        '../testing/gmock.gyp:gmock',
893        '../testing/gtest.gyp:gtest',
894        '../third_party/icu/icu.gyp:icuuc',
895        '../third_party/libxml/libxml.gyp:libxml',
896        'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
897      ],
898      'export_dependent_settings': [
899        'base',
900      ],
901      'conditions': [
902        ['os_posix==0', {
903          'sources!': [
904            'test/scoped_locale.cc',
905            'test/scoped_locale.h',
906          ],
907        }],
908        ['os_bsd==1', {
909          'sources!': [
910            'test/test_file_util_linux.cc',
911          ],
912        }],
913        ['OS == "android"', {
914          'dependencies': [
915            'base_unittests_jni_headers',
916            'base_java_unittest_support',
917          ],
918        }],
919        ['OS == "ios"', {
920          'toolsets': ['host', 'target'],
921        }],
922      ],
923      'sources': [
924        'test/gtest_util.cc',
925        'test/gtest_util.h',
926        'test/gtest_xml_unittest_result_printer.cc',
927        'test/gtest_xml_unittest_result_printer.h',
928        'test/gtest_xml_util.cc',
929        'test/gtest_xml_util.h',
930        'test/histogram_tester.cc',
931        'test/histogram_tester.h',
932        'test/icu_test_util.cc',
933        'test/icu_test_util.h',
934        'test/ios/wait_util.h',
935        'test/ios/wait_util.mm',
936        'test/launcher/test_launcher.cc',
937        'test/launcher/test_launcher.h',
938        'test/launcher/test_result.cc',
939        'test/launcher/test_result.h',
940        'test/launcher/test_results_tracker.cc',
941        'test/launcher/test_results_tracker.h',
942        'test/launcher/unit_test_launcher.cc',
943        'test/launcher/unit_test_launcher.h',
944        'test/launcher/unit_test_launcher_ios.cc',
945        'test/mock_chrome_application_mac.h',
946        'test/mock_chrome_application_mac.mm',
947        'test/mock_devices_changed_observer.cc',
948        'test/mock_devices_changed_observer.h',
949        'test/mock_entropy_provider.cc',
950        'test/mock_entropy_provider.h',
951        'test/mock_log.cc',
952        'test/mock_log.h',
953        'test/multiprocess_test.cc',
954        'test/multiprocess_test.h',
955        'test/multiprocess_test_android.cc',
956        'test/null_task_runner.cc',
957        'test/null_task_runner.h',
958        'test/opaque_ref_counted.cc',
959        'test/opaque_ref_counted.h',
960        'test/perf_log.cc',
961        'test/perf_log.h',
962        'test/perf_test_suite.cc',
963        'test/perf_test_suite.h',
964        'test/perf_time_logger.cc',
965        'test/perf_time_logger.h',
966        'test/power_monitor_test_base.cc',
967        'test/power_monitor_test_base.h',
968        'test/scoped_locale.cc',
969        'test/scoped_locale.h',
970        'test/scoped_path_override.cc',
971        'test/scoped_path_override.h',
972        'test/sequenced_task_runner_test_template.cc',
973        'test/sequenced_task_runner_test_template.h',
974        'test/sequenced_worker_pool_owner.cc',
975        'test/sequenced_worker_pool_owner.h',
976        'test/simple_test_clock.cc',
977        'test/simple_test_clock.h',
978        'test/simple_test_tick_clock.cc',
979        'test/simple_test_tick_clock.h',
980        'test/task_runner_test_template.cc',
981        'test/task_runner_test_template.h',
982        'test/test_discardable_memory_allocator.cc',
983        'test/test_discardable_memory_allocator.h',
984        'test/test_file_util.cc',
985        'test/test_file_util.h',
986        'test/test_file_util_android.cc',
987        'test/test_file_util_linux.cc',
988        'test/test_file_util_mac.cc',
989        'test/test_file_util_posix.cc',
990        'test/test_file_util_win.cc',
991        'test/test_io_thread.cc',
992        'test/test_io_thread.h',
993        'test/test_listener_ios.h',
994        'test/test_listener_ios.mm',
995        'test/test_mock_time_task_runner.cc',
996        'test/test_mock_time_task_runner.h',
997        'test/test_pending_task.cc',
998        'test/test_pending_task.h',
999        'test/test_reg_util_win.cc',
1000        'test/test_reg_util_win.h',
1001        'test/test_shortcut_win.cc',
1002        'test/test_shortcut_win.h',
1003        'test/test_simple_task_runner.cc',
1004        'test/test_simple_task_runner.h',
1005        'test/test_suite.cc',
1006        'test/test_suite.h',
1007        'test/test_support_android.cc',
1008        'test/test_support_android.h',
1009        'test/test_support_ios.h',
1010        'test/test_support_ios.mm',
1011        'test/test_switches.cc',
1012        'test/test_switches.h',
1013        'test/test_timeouts.cc',
1014        'test/test_timeouts.h',
1015        'test/test_ui_thread_android.cc',
1016        'test/test_ui_thread_android.h',
1017        'test/thread_test_helper.cc',
1018        'test/thread_test_helper.h',
1019        'test/trace_event_analyzer.cc',
1020        'test/trace_event_analyzer.h',
1021        'test/trace_to_file.cc',
1022        'test/trace_to_file.h',
1023        'test/user_action_tester.cc',
1024        'test/user_action_tester.h',
1025        'test/values_test_util.cc',
1026        'test/values_test_util.h',
1027      ],
1028      'target_conditions': [
1029        ['OS == "ios"', {
1030          'sources/': [
1031            # Pull in specific Mac files for iOS (which have been filtered out
1032            # by file name rules).
1033            ['include', '^test/test_file_util_mac\\.cc$'],
1034          ],
1035        }],
1036        ['OS == "ios" and _toolset == "target"', {
1037          'sources!': [
1038            # iOS uses its own unit test launcher.
1039            'test/launcher/unit_test_launcher.cc',
1040          ],
1041        }],
1042        ['OS == "ios" and _toolset == "host"', {
1043          'sources!': [
1044            'test/launcher/unit_test_launcher_ios.cc',
1045            'test/test_support_ios.h',
1046            'test/test_support_ios.mm',
1047          ],
1048        }],
1049      ],  # target_conditions
1050    },
1051    {
1052      'target_name': 'test_support_perf',
1053      'type': 'static_library',
1054      'dependencies': [
1055        'base',
1056        'test_support_base',
1057        '../testing/gtest.gyp:gtest',
1058      ],
1059      'sources': [
1060        'test/run_all_perftests.cc',
1061      ],
1062      'direct_dependent_settings': {
1063        'defines': [
1064          'PERF_TEST',
1065        ],
1066      },
1067    },
1068    {
1069      'target_name': 'test_launcher_nacl_nonsfi',
1070      'conditions': [
1071        ['disable_nacl==0 and disable_nacl_untrusted==0 and enable_nacl_nonsfi_test==1', {
1072          'type': 'static_library',
1073          'sources': [
1074            'test/launcher/test_launcher_nacl_nonsfi.cc',
1075          ],
1076          'dependencies': [
1077            'test_support_base',
1078          ],
1079        }, {
1080          'type': 'none',
1081        }],
1082      ],
1083    },
1084    {
1085      # GN version: //base/debug:debugging_flags
1086      # Since this generates a file, it most only be referenced in the target
1087      # toolchain or there will be multiple rules that generate the header.
1088      # When referenced from a target that might be compiled in the host
1089      # toolchain, always refer to 'base_debugging_flags#target'.
1090      'target_name': 'base_debugging_flags',
1091      'includes': [ '../build/buildflag_header.gypi' ],
1092      'variables': {
1093        'buildflag_header_path': 'base/debug/debugging_flags.h',
1094        'buildflag_flags': [
1095          'ENABLE_PROFILING=<(profiling)',
1096        ],
1097      },
1098    },
1099  ],
1100  'conditions': [
1101    ['OS=="ios" and "<(GENERATOR)"=="ninja"', {
1102      'targets': [
1103        {
1104          'target_name': 'test_launcher',
1105          'toolsets': ['host'],
1106          'type': 'executable',
1107          'dependencies': [
1108            'test_support_base',
1109          ],
1110          'sources': [
1111            'test/launcher/test_launcher_ios.cc',
1112          ],
1113        },
1114      ],
1115    }],
1116    ['OS!="ios"', {
1117      'targets': [
1118        {
1119          # GN: //base:check_example
1120          'target_name': 'check_example',
1121          'type': 'executable',
1122          'sources': [
1123            'check_example.cc',
1124          ],
1125          'dependencies': [
1126            'base',
1127          ],
1128        },
1129        {
1130          'target_name': 'build_utf8_validator_tables',
1131          'type': 'executable',
1132          'toolsets': ['host'],
1133          'dependencies': [
1134            'base',
1135            '../third_party/icu/icu.gyp:icuuc',
1136          ],
1137          'sources': [
1138            'i18n/build_utf8_validator_tables.cc'
1139          ],
1140        },
1141      ],
1142    }],
1143    ['OS == "win" and target_arch=="ia32"', {
1144      'targets': [
1145        # The base_win64 target here allows us to use base for Win64 targets
1146        # (the normal build is 32 bits).
1147        {
1148          'target_name': 'base_win64',
1149          'type': '<(component)',
1150          'variables': {
1151            'base_target': 1,
1152          },
1153          'dependencies': [
1154            'base_debugging_flags#target',
1155            'base_static_win64',
1156            '../third_party/modp_b64/modp_b64.gyp:modp_b64_win64',
1157            'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
1158            'trace_event/etw_manifest/etw_manifest.gyp:etw_manifest',
1159          ],
1160          # TODO(gregoryd): direct_dependent_settings should be shared with the
1161          # 32-bit target, but it doesn't work due to a bug in gyp
1162          'direct_dependent_settings': {
1163            'include_dirs': [
1164              '..',
1165            ],
1166          },
1167          'defines': [
1168            'BASE_WIN64',
1169            '<@(nacl_win64_defines)',
1170          ],
1171          'configurations': {
1172            'Common_Base': {
1173              'msvs_target_platform': 'x64',
1174            },
1175          },
1176          'conditions': [
1177            ['component == "shared_library"', {
1178              'sources!': [
1179                'debug/debug_on_start_win.cc',
1180              ],
1181            }],
1182          ],
1183          # Specify delayload for base_win64.dll.
1184          'msvs_settings': {
1185            'VCLinkerTool': {
1186              'DelayLoadDLLs': [
1187                'cfgmgr32.dll',
1188                'powrprof.dll',
1189                'setupapi.dll',
1190              ],
1191              'AdditionalDependencies': [
1192                'cfgmgr32.lib',
1193                'powrprof.lib',
1194                'setupapi.lib',
1195              ],
1196            },
1197          },
1198          # Specify delayload for components that link with base_win64.lib.
1199          'all_dependent_settings': {
1200            'msvs_settings': {
1201              'VCLinkerTool': {
1202                'DelayLoadDLLs': [
1203                  'cfgmgr32.dll',
1204                  'powrprof.dll',
1205                  'setupapi.dll',
1206                ],
1207                'AdditionalDependencies': [
1208                  'cfgmgr32.lib',
1209                  'powrprof.lib',
1210                  'setupapi.lib',
1211                ],
1212              },
1213            },
1214          },
1215          # TODO(rvargas): Bug 78117. Remove this.
1216          'msvs_disabled_warnings': [
1217            4244,
1218            4996,
1219            4267,
1220          ],
1221          'sources': [
1222            'auto_reset.h',
1223            'linux_util.cc',
1224            'linux_util.h',
1225            'md5.cc',
1226            'md5.h',
1227            'message_loop/message_pump_libevent.cc',
1228            'message_loop/message_pump_libevent.h',
1229            'metrics/field_trial.cc',
1230            'metrics/field_trial.h',
1231            'posix/file_descriptor_shuffle.cc',
1232            'posix/file_descriptor_shuffle.h',
1233            'sync_socket.h',
1234            'sync_socket_posix.cc',
1235            'sync_socket_win.cc',
1236            'third_party/xdg_user_dirs/xdg_user_dir_lookup.cc',
1237            'third_party/xdg_user_dirs/xdg_user_dir_lookup.h',
1238          ],
1239        },
1240        {
1241          'target_name': 'base_i18n_nacl_win64',
1242          'type': '<(component)',
1243          # TODO(gregoryd): direct_dependent_settings should be shared with the
1244          # 32-bit target, but it doesn't work due to a bug in gyp
1245          'direct_dependent_settings': {
1246            'include_dirs': [
1247              '..',
1248            ],
1249          },
1250          'defines': [
1251            '<@(nacl_win64_defines)',
1252            'BASE_I18N_IMPLEMENTATION',
1253          ],
1254          'include_dirs': [
1255            '..',
1256          ],
1257          'sources': [
1258            'i18n/icu_util_nacl_win64.cc',
1259          ],
1260          'configurations': {
1261            'Common_Base': {
1262              'msvs_target_platform': 'x64',
1263            },
1264          },
1265        },
1266        {
1267          # TODO(rvargas): Remove this when gyp finally supports a clean model.
1268          # See bug 36232.
1269          'target_name': 'base_static_win64',
1270          'type': 'static_library',
1271          'sources': [
1272            'base_switches.cc',
1273            'base_switches.h',
1274            'win/pe_image.cc',
1275            'win/pe_image.h',
1276          ],
1277          'sources!': [
1278            # base64.cc depends on modp_b64.
1279            'base64.cc',
1280          ],
1281          'include_dirs': [
1282            '..',
1283          ],
1284          'configurations': {
1285            'Common_Base': {
1286              'msvs_target_platform': 'x64',
1287            },
1288          },
1289          'defines': [
1290            '<@(nacl_win64_defines)',
1291          ],
1292          # TODO(rvargas): Bug 78117. Remove this.
1293          'msvs_disabled_warnings': [
1294            4244,
1295          ],
1296        },
1297      ],
1298    }],
1299    ['OS == "win" and target_arch=="x64"', {
1300      'targets': [
1301        {
1302          'target_name': 'base_profiler_test_support_library',
1303          # Must be a shared library so that it can be unloaded during testing.
1304          'type': 'shared_library',
1305          'include_dirs': [
1306            '..',
1307          ],
1308          'sources': [
1309            'profiler/test_support_library.cc',
1310          ],
1311        },
1312      ]
1313    }],
1314    ['os_posix==1 and OS!="mac" and OS!="ios"', {
1315      'targets': [
1316        {
1317          'target_name': 'symbolize',
1318          'type': 'static_library',
1319          'toolsets': ['host', 'target'],
1320          'variables': {
1321            'chromium_code': 0,
1322          },
1323          'conditions': [
1324            ['OS == "solaris"', {
1325              'include_dirs': [
1326                '/usr/gnu/include',
1327                '/usr/gnu/include/libelf',
1328              ],
1329            },],
1330          ],
1331          'cflags': [
1332            '-Wno-sign-compare',
1333          ],
1334          'cflags!': [
1335            '-Wextra',
1336          ],
1337          'defines': [
1338            'GLOG_BUILD_CONFIG_INCLUDE="build/build_config.h"',
1339          ],
1340          'sources': [
1341            'third_party/symbolize/config.h',
1342            'third_party/symbolize/demangle.cc',
1343            'third_party/symbolize/demangle.h',
1344            'third_party/symbolize/glog/logging.h',
1345            'third_party/symbolize/glog/raw_logging.h',
1346            'third_party/symbolize/symbolize.cc',
1347            'third_party/symbolize/symbolize.h',
1348            'third_party/symbolize/utilities.h',
1349          ],
1350          'include_dirs': [
1351            '..',
1352          ],
1353          'includes': [
1354            '../build/android/increase_size_for_speed.gypi',
1355          ],
1356        },
1357        {
1358          'target_name': 'xdg_mime',
1359          'type': 'static_library',
1360          'toolsets': ['host', 'target'],
1361          'variables': {
1362            'chromium_code': 0,
1363          },
1364          'cflags!': [
1365            '-Wextra',
1366          ],
1367          'sources': [
1368            'third_party/xdg_mime/xdgmime.c',
1369            'third_party/xdg_mime/xdgmime.h',
1370            'third_party/xdg_mime/xdgmimealias.c',
1371            'third_party/xdg_mime/xdgmimealias.h',
1372            'third_party/xdg_mime/xdgmimecache.c',
1373            'third_party/xdg_mime/xdgmimecache.h',
1374            'third_party/xdg_mime/xdgmimeglob.c',
1375            'third_party/xdg_mime/xdgmimeglob.h',
1376            'third_party/xdg_mime/xdgmimeicon.c',
1377            'third_party/xdg_mime/xdgmimeicon.h',
1378            'third_party/xdg_mime/xdgmimeint.c',
1379            'third_party/xdg_mime/xdgmimeint.h',
1380            'third_party/xdg_mime/xdgmimemagic.c',
1381            'third_party/xdg_mime/xdgmimemagic.h',
1382            'third_party/xdg_mime/xdgmimeparent.c',
1383            'third_party/xdg_mime/xdgmimeparent.h',
1384          ],
1385          'includes': [
1386            '../build/android/increase_size_for_speed.gypi',
1387          ],
1388        },
1389      ],
1390    }],
1391    ['OS == "linux"', {
1392      'targets': [
1393        {
1394          'target_name': 'malloc_wrapper',
1395          'type': 'shared_library',
1396          'dependencies': [
1397            'base',
1398          ],
1399          'sources': [
1400            'test/malloc_wrapper.cc',
1401          ],
1402        }
1403      ],
1404    }],
1405    ['OS == "android"', {
1406      'targets': [
1407        {
1408          # GN: //base:base_jni_headers
1409          'target_name': 'base_jni_headers',
1410          'type': 'none',
1411          'sources': [
1412            'android/java/src/org/chromium/base/ApkAssets.java',
1413            'android/java/src/org/chromium/base/ApplicationStatus.java',
1414            'android/java/src/org/chromium/base/AnimationFrameTimeHistogram.java',
1415            'android/java/src/org/chromium/base/BuildInfo.java',
1416            'android/java/src/org/chromium/base/CommandLine.java',
1417            'android/java/src/org/chromium/base/ContentUriUtils.java',
1418            'android/java/src/org/chromium/base/ContextUtils.java',
1419            'android/java/src/org/chromium/base/CpuFeatures.java',
1420            'android/java/src/org/chromium/base/EventLog.java',
1421            'android/java/src/org/chromium/base/FieldTrialList.java',
1422            'android/java/src/org/chromium/base/ImportantFileWriterAndroid.java',
1423            'android/java/src/org/chromium/base/JNIUtils.java',
1424            'android/java/src/org/chromium/base/JavaHandlerThread.java',
1425            'android/java/src/org/chromium/base/LocaleUtils.java',
1426            'android/java/src/org/chromium/base/MemoryPressureListener.java',
1427            'android/java/src/org/chromium/base/PathService.java',
1428            'android/java/src/org/chromium/base/PathUtils.java',
1429            'android/java/src/org/chromium/base/PowerMonitor.java',
1430            'android/java/src/org/chromium/base/SysUtils.java',
1431            'android/java/src/org/chromium/base/SystemMessageHandler.java',
1432            'android/java/src/org/chromium/base/ThreadUtils.java',
1433            'android/java/src/org/chromium/base/TraceEvent.java',
1434            'android/java/src/org/chromium/base/library_loader/LibraryLoader.java',
1435            'android/java/src/org/chromium/base/metrics/RecordHistogram.java',
1436            'android/java/src/org/chromium/base/metrics/RecordUserAction.java',
1437          ],
1438          'variables': {
1439            'jni_gen_package': 'base',
1440          },
1441          'dependencies': [
1442            'android_runtime_jni_headers',
1443          ],
1444          'includes': [ '../build/jni_generator.gypi' ],
1445        },
1446        {
1447          # GN: //base:android_runtime_jni_headers
1448          'target_name': 'android_runtime_jni_headers',
1449          'type': 'none',
1450          'variables': {
1451            'jni_gen_package': 'base',
1452            'input_java_class': 'java/lang/Runtime.class',
1453          },
1454          'includes': [ '../build/jar_file_jni_generator.gypi' ],
1455        },
1456        {
1457          # GN: //base:base_unittests_jni_headers
1458          'target_name': 'base_unittests_jni_headers',
1459          'type': 'none',
1460          'sources': [
1461            'test/android/java/src/org/chromium/base/ContentUriTestUtils.java',
1462            'test/android/java/src/org/chromium/base/TestUiThread.java',
1463          ],
1464          'variables': {
1465            'jni_gen_package': 'base',
1466          },
1467          'includes': [ '../build/jni_generator.gypi' ],
1468        },
1469        {
1470          # GN: //base:base_native_libraries_gen
1471          'target_name': 'base_native_libraries_gen',
1472          'type': 'none',
1473          'sources': [
1474            'android/java/templates/NativeLibraries.template',
1475          ],
1476          'variables': {
1477            'package_name': 'org/chromium/base/library_loader',
1478            'template_deps': [],
1479          },
1480          'includes': [ '../build/android/java_cpp_template.gypi' ],
1481        },
1482        {
1483          # GN: //base:base_multidex_gen
1484          'target_name': 'base_multidex_gen',
1485          'type': 'none',
1486          'sources': [
1487            'android/java/templates/ChromiumMultiDex.template',
1488          ],
1489          'variables': {
1490            'package_name': 'org/chromium/base/multidex',
1491            'template_deps': [],
1492            'additional_gcc_preprocess_options': [
1493              '--defines', 'MULTIDEX_CONFIGURATION_<(CONFIGURATION_NAME)',
1494            ],
1495          },
1496          'includes': ['../build/android/java_cpp_template.gypi'],
1497        },
1498        {
1499          # GN: //base:base_android_java_enums_srcjar
1500          'target_name': 'base_java_library_process_type',
1501          'type': 'none',
1502          'variables': {
1503            'source_file': 'android/library_loader/library_loader_hooks.h',
1504          },
1505          'includes': [ '../build/android/java_cpp_enum.gypi' ],
1506        },
1507        {
1508          # GN: //base:base_java
1509          'target_name': 'base_java',
1510          'type': 'none',
1511          'variables': {
1512            'java_in_dir': 'android/java',
1513            'jar_excluded_classes': [ '*/NativeLibraries.class' ],
1514          },
1515          'dependencies': [
1516            'base_java_application_state',
1517            'base_java_library_load_from_apk_status_codes',
1518            'base_java_library_process_type',
1519            'base_java_memory_pressure_level',
1520            'base_multidex_gen',
1521            'base_native_libraries_gen',
1522            '../third_party/android_tools/android_tools.gyp:android_support_multidex_javalib',
1523            '../third_party/jsr-305/jsr-305.gyp:jsr_305_javalib',
1524          ],
1525          'includes': [ '../build/java.gypi' ],
1526        },
1527        {
1528          # GN: //base:base_java_unittest_support
1529          'target_name': 'base_java_unittest_support',
1530          'type': 'none',
1531          'dependencies': [
1532            'base_java',
1533          ],
1534          'variables': {
1535            'java_in_dir': '../base/test/android/java',
1536          },
1537          'includes': [ '../build/java.gypi' ],
1538        },
1539        {
1540          # GN: //base:base_android_java_enums_srcjar
1541          'target_name': 'base_java_application_state',
1542          'type': 'none',
1543          'variables': {
1544            'source_file': 'android/application_status_listener.h',
1545          },
1546          'includes': [ '../build/android/java_cpp_enum.gypi' ],
1547        },
1548        {
1549          # GN: //base:base_android_java_enums_srcjar
1550          'target_name': 'base_java_library_load_from_apk_status_codes',
1551          'type': 'none',
1552          'variables': {
1553            'source_file': 'android/library_loader/library_load_from_apk_status_codes.h'
1554          },
1555          'includes': [ '../build/android/java_cpp_enum.gypi' ],
1556        },
1557        {
1558          # GN: //base:base_android_java_enums_srcjar
1559          'target_name': 'base_java_memory_pressure_level',
1560          'type': 'none',
1561          'variables': {
1562            'source_file': 'memory/memory_pressure_listener.h',
1563          },
1564          'includes': [ '../build/android/java_cpp_enum.gypi' ],
1565        },
1566        {
1567          # GN: //base:base_java_test_support
1568          'target_name': 'base_java_test_support',
1569          'type': 'none',
1570          'dependencies': [
1571            'base_java',
1572            '../testing/android/on_device_instrumentation.gyp:reporter_java',
1573          ],
1574          'variables': {
1575            'java_in_dir': '../base/test/android/javatests',
1576          },
1577          'includes': [ '../build/java.gypi' ],
1578        },
1579        {
1580          # TODO(jbudorick): Remove this once we roll to robolectric 3.0 and pull
1581          # in the multidex shadow library. crbug.com/522043
1582          # GN: //base:base_junit_test_support
1583          'target_name': 'base_junit_test_support',
1584          'type': 'none',
1585          'dependencies': [
1586            '../testing/android/junit/junit_test.gyp:junit_test_support',
1587            '../third_party/android_tools/android_tools.gyp:android_support_multidex_javalib',
1588          ],
1589          'variables': {
1590            'src_paths': [
1591              '../base/test/android/junit/src/org/chromium/base/test/shadows/ShadowMultiDex.java',
1592            ],
1593          },
1594          'includes': [ '../build/host_jar.gypi' ]
1595        },
1596        {
1597          # GN: //base:base_junit_tests
1598          'target_name': 'base_junit_tests',
1599          'type': 'none',
1600          'dependencies': [
1601            'base_java',
1602            'base_java_test_support',
1603            'base_junit_test_support',
1604            '../testing/android/junit/junit_test.gyp:junit_test_support',
1605          ],
1606          'variables': {
1607             'main_class': 'org.chromium.testing.local.JunitTestMain',
1608             'src_paths': [
1609               '../base/android/junit/',
1610               '../base/test/android/junit/src/org/chromium/base/test/util/DisableIfTest.java',
1611             ],
1612           },
1613          'includes': [ '../build/host_jar.gypi' ],
1614        },
1615        {
1616          # GN: //base:base_javatests
1617          'target_name': 'base_javatests',
1618          'type': 'none',
1619          'dependencies': [
1620            'base_java',
1621            'base_java_test_support',
1622          ],
1623          'variables': {
1624            'java_in_dir': '../base/android/javatests',
1625          },
1626          'includes': [ '../build/java.gypi' ],
1627        },
1628        {
1629          # GN: //base/android/linker:chromium_android_linker
1630          'target_name': 'chromium_android_linker',
1631          'type': 'shared_library',
1632          'sources': [
1633            'android/linker/android_dlext.h',
1634            'android/linker/legacy_linker_jni.cc',
1635            'android/linker/legacy_linker_jni.h',
1636            'android/linker/linker_jni.cc',
1637            'android/linker/linker_jni.h',
1638            'android/linker/modern_linker_jni.cc',
1639            'android/linker/modern_linker_jni.h',
1640          ],
1641          # The crazy linker is never instrumented.
1642          'cflags!': [
1643            '-finstrument-functions',
1644          ],
1645          'dependencies': [
1646            # The NDK contains the crazy_linker here:
1647            #   '<(android_ndk_root)/crazy_linker.gyp:crazy_linker'
1648            # However, we use our own fork.  See bug 384700.
1649            '../third_party/android_crazy_linker/crazy_linker.gyp:crazy_linker',
1650          ],
1651        },
1652        {
1653          # GN: //base:base_perftests_apk
1654          'target_name': 'base_perftests_apk',
1655          'type': 'none',
1656          'dependencies': [
1657            'base_perftests',
1658          ],
1659          'variables': {
1660            'test_suite_name': 'base_perftests',
1661          },
1662          'includes': [ '../build/apk_test.gypi' ],
1663        },
1664        {
1665          # GN: //base:base_unittests_apk
1666          'target_name': 'base_unittests_apk',
1667          'type': 'none',
1668          'dependencies': [
1669            'base_java',
1670            'base_unittests',
1671          ],
1672          'variables': {
1673            'test_suite_name': 'base_unittests',
1674            'isolate_file': 'base_unittests.isolate',
1675          },
1676          'includes': [ '../build/apk_test.gypi' ],
1677        },
1678      ],
1679      'conditions': [
1680        ['test_isolation_mode != "noop"',
1681          {
1682            'targets': [
1683              {
1684                'target_name': 'base_unittests_apk_run',
1685                'type': 'none',
1686                'dependencies': [
1687                  'base_unittests_apk',
1688                ],
1689                'includes': [
1690                  '../build/isolate.gypi',
1691                ],
1692                'sources': [
1693                  'base_unittests_apk.isolate',
1694                ],
1695              },
1696            ]
1697          }
1698        ],
1699      ],
1700    }],
1701    ['OS == "win"', {
1702      'targets': [
1703        {
1704          # Target to manually rebuild pe_image_test.dll which is checked into
1705          # base/test/data/pe_image.
1706          'target_name': 'pe_image_test',
1707          'type': 'shared_library',
1708          'sources': [
1709            'win/pe_image_test.cc',
1710          ],
1711          'msvs_settings': {
1712            'VCLinkerTool': {
1713              'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
1714              'DelayLoadDLLs': [
1715                'cfgmgr32.dll',
1716                'shell32.dll',
1717              ],
1718              'AdditionalDependencies': [
1719                'cfgmgr32.lib',
1720                'shell32.lib',
1721              ],
1722            },
1723          },
1724        },
1725      ],
1726    }],
1727    ['test_isolation_mode != "noop"', {
1728      'targets': [
1729        {
1730          'target_name': 'base_unittests_run',
1731          'type': 'none',
1732          'dependencies': [
1733            'base_unittests',
1734          ],
1735          'includes': [
1736            '../build/isolate.gypi',
1737          ],
1738          'sources': [
1739            'base_unittests.isolate',
1740          ],
1741        },
1742      ],
1743    }],
1744  ],
1745}
1746