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