Home | History | Annotate | Download | only in base
      1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 {
      6   'target_defaults': {
      7     'variables': {
      8       'base_target': 0,
      9     },
     10     'target_conditions': [
     11       # This part is shared between the targets defined below.
     12       ['base_target==1', {
     13         'sources': [
     14           '../build/build_config.h',
     15           'third_party/dmg_fp/dmg_fp.h',
     16           'third_party/dmg_fp/g_fmt.cc',
     17           'third_party/dmg_fp/dtoa_wrapper.cc',
     18           'third_party/icu/icu_utf.cc',
     19           'third_party/icu/icu_utf.h',
     20           'third_party/nspr/prtime.cc',
     21           'third_party/nspr/prtime.h',
     22           'at_exit.cc',
     23           'at_exit.h',
     24           'atomic_ref_count.h',
     25           'atomic_sequence_num.h',
     26           'atomicops.h',
     27           'atomicops_internals_x86_gcc.cc',
     28           'atomicops_internals_x86_msvc.h',
     29           'base_api.h',
     30           'base_paths.cc',
     31           'base_paths.h',
     32           'base_paths_mac.h',
     33           'base_paths_mac.mm',
     34           'base_paths_linux.cc',
     35           'base_paths_win.cc',
     36           'base_paths_win.h',
     37           'basictypes.h',
     38           'bind.h',
     39           'bind_helpers.h',
     40           'bind_internal.h',
     41           'bind_internal_win.h',
     42           'bits.h',
     43           'bzip2_error_handler.cc',
     44           'callback.h',
     45           'callback_internal.cc',
     46           'callback_internal.h',
     47           'callback_old.h',
     48           'command_line.cc',
     49           'command_line.h',
     50           'compiler_specific.h',
     51           'cpu.cc',
     52           'cpu.h',
     53           'debug/debug_on_start_win.cc',
     54           'debug/debug_on_start_win.h',
     55           'debug/debugger.cc',
     56           'debug/debugger.h',
     57           'debug/debugger_posix.cc',
     58           'debug/debugger_win.cc',
     59           'debug/leak_annotations.h',
     60           'debug/leak_tracker.h',
     61           'debug/profiler.cc',
     62           'debug/profiler.h',
     63           'debug/stack_trace.cc',
     64           'debug/stack_trace.h',
     65           'debug/stack_trace_posix.cc',
     66           'debug/stack_trace_win.cc',
     67           'debug/trace_event_win.cc',
     68           'debug/trace_event.cc',
     69           'debug/trace_event.h',
     70           'dir_reader_fallback.h',
     71           'dir_reader_linux.h',
     72           'dir_reader_posix.h',
     73           'environment.cc',
     74           'environment.h',
     75           'file_path.cc',
     76           'file_path.h',
     77           'file_util.cc',
     78           'file_util.h',
     79           'file_util_deprecated.h',
     80           'file_util_linux.cc',
     81           'file_util_mac.mm',
     82           'file_util_posix.cc',
     83           'file_util_win.cc',
     84           'file_util_proxy.cc',
     85           'file_util_proxy.h',
     86           'file_version_info.h',
     87           'file_version_info_mac.h',
     88           'file_version_info_mac.mm',
     89           'file_version_info_win.cc',
     90           'file_version_info_win.h',
     91           'files/file_path_watcher.cc',
     92           'files/file_path_watcher.h',
     93           'files/file_path_watcher_linux.cc',
     94           'files/file_path_watcher_mac.cc',
     95           'files/file_path_watcher_win.cc',
     96           'fix_wp64.h',
     97           'float_util.h',
     98           'foundation_utils_mac.h',
     99           'global_descriptors_posix.cc',
    100           'global_descriptors_posix.h',
    101           'gtest_prod_util.h',
    102           'hash_tables.h',
    103           'id_map.h',
    104           'json/json_reader.cc',
    105           'json/json_reader.h',
    106           'json/json_writer.cc',
    107           'json/json_writer.h',
    108           'json/string_escape.cc',
    109           'json/string_escape.h',
    110           'lazy_instance.cc',
    111           'lazy_instance.h',
    112           'linked_list.h',
    113           'logging.cc',
    114           'logging.h',
    115           'logging_win.cc',
    116           'logging_win.h',
    117           'mac/cocoa_protocols.h',
    118           'mac/foundation_util.h',
    119           'mac/foundation_util.mm',
    120           'mac/mac_util.h',
    121           'mac/mac_util.mm',
    122           'mac/os_crash_dumps.cc',
    123           'mac/os_crash_dumps.h',
    124           'mac/scoped_aedesc.h',
    125           'mac/scoped_cftyperef.h',
    126           'mac/scoped_nsautorelease_pool.h',
    127           'mac/scoped_nsautorelease_pool.mm',
    128           'mach_ipc_mac.h',
    129           'mach_ipc_mac.mm',
    130           'memory/linked_ptr.h',
    131           'memory/memory_debug.cc',
    132           'memory/memory_debug.h',
    133           'memory/raw_scoped_refptr_mismatch_checker.h',
    134           'memory/ref_counted.cc',
    135           'memory/ref_counted.h',
    136           'memory/ref_counted_memory.cc',
    137           'memory/ref_counted_memory.h',
    138           'memory/scoped_callback_factory.h',
    139           'memory/scoped_handle.h',
    140           'memory/scoped_native_library.cc',
    141           'memory/scoped_native_library.h',
    142           'memory/scoped_nsobject.h',
    143           'memory/scoped_open_process.h',
    144           'memory/scoped_ptr.h',
    145           'memory/scoped_temp_dir.cc',
    146           'memory/scoped_temp_dir.h',
    147           'memory/scoped_vector.h',
    148           'memory/singleton.h',
    149           'memory/weak_ptr.cc',
    150           'memory/weak_ptr.h',
    151           'message_loop.cc',
    152           'message_loop.h',
    153           'message_loop_proxy.cc',
    154           'message_loop_proxy.h',
    155           'message_loop_proxy_impl.cc',
    156           'message_loop_proxy_impl.h',
    157           'message_pump.cc',
    158           'message_pump.h',
    159           'message_pump_default.cc',
    160           'message_pump_default.h',
    161           'message_pump_win.cc',
    162           'message_pump_win.h',
    163           'metrics/histogram.cc',
    164           'metrics/histogram.h',
    165           'metrics/nacl_histogram.cc',
    166           'metrics/nacl_histogram.h',
    167           'metrics/stats_counters.cc',
    168           'metrics/stats_counters.h',
    169           'metrics/stats_table.cc',
    170           'metrics/stats_table.h',
    171           'mime_util.h',
    172           'mime_util_xdg.cc',
    173           'native_library.h',
    174           'native_library_linux.cc',
    175           'native_library_mac.mm',
    176           'native_library_win.cc',
    177           'observer_list.h',
    178           'observer_list_threadsafe.h',
    179           'path_service.cc',
    180           'path_service.h',
    181           'pickle.cc',
    182           'pickle.h',
    183           'platform_file.cc',
    184           'platform_file.h',
    185           'platform_file_posix.cc',
    186           'platform_file_win.cc',
    187           'port.h',
    188           'process.h',
    189           'process_linux.cc',
    190           'process_posix.cc',
    191           'process_util.cc',
    192           'process_util.h',
    193           'process_util_linux.cc',
    194           'process_util_mac.mm',
    195           'process_util_posix.cc',
    196           'process_util_win.cc',
    197           'process_win.cc',
    198           'rand_util.cc',
    199           'rand_util.h',
    200           'rand_util_posix.cc',
    201           'rand_util_win.cc',
    202           'resource_util.cc',
    203           'resource_util.h',
    204           'safe_strerror_posix.cc',
    205           'safe_strerror_posix.h',
    206           'scoped_ptr.h',
    207           'sha1.h',
    208           'sha1_portable.cc',
    209           'sha1_win.cc',
    210           'shared_memory.h',
    211           'shared_memory_posix.cc',
    212           'shared_memory_win.cc',
    213           'spin_wait.h',
    214           'stack_container.h',
    215           'stl_util-inl.h',
    216           'string_number_conversions.cc',
    217           'string_number_conversions.h',
    218           'string_piece.cc',
    219           'string_piece.h',
    220           'string_split.cc',
    221           'string_split.h',
    222           'string_tokenizer.h',
    223           'string_util.cc',
    224           'string_util.h',
    225           'string_util_win.h',
    226           'stringize_macros.h',
    227           'stringprintf.cc',
    228           'stringprintf.h',
    229           'synchronization/cancellation_flag.cc',
    230           'synchronization/cancellation_flag.h',
    231           'synchronization/condition_variable.h',
    232           'synchronization/condition_variable_posix.cc',
    233           'synchronization/condition_variable_win.cc',
    234           'synchronization/lock.cc',
    235           'synchronization/lock.h',
    236           'synchronization/lock_impl.h',
    237           'synchronization/lock_impl_posix.cc',
    238           'synchronization/lock_impl_win.cc',
    239           'synchronization/waitable_event.h',
    240           'synchronization/waitable_event_posix.cc',
    241           'synchronization/waitable_event_watcher.h',
    242           'synchronization/waitable_event_watcher_posix.cc',
    243           'synchronization/waitable_event_watcher_win.cc',
    244           'synchronization/waitable_event_win.cc',
    245           'sys_info.h',
    246           'sys_info_chromeos.cc',
    247           'sys_info_freebsd.cc',
    248           'sys_info_linux.cc',
    249           'sys_info_mac.cc',
    250           'sys_info_openbsd.cc',
    251           'sys_info_posix.cc',
    252           'sys_info_win.cc',
    253           'sys_string_conversions.h',
    254           'sys_string_conversions_linux.cc',
    255           'sys_string_conversions_mac.mm',
    256           'sys_string_conversions_win.cc',
    257           'task.cc',
    258           'task.h',
    259           'task_queue.cc',
    260           'task_queue.h',
    261           'template_util.h',
    262           'threading/non_thread_safe.h',
    263           'threading/non_thread_safe_impl.cc',
    264           'threading/non_thread_safe_impl.h',
    265           'threading/platform_thread.h',
    266           'threading/platform_thread_mac.mm',
    267           'threading/platform_thread_posix.cc',
    268           'threading/platform_thread_win.cc',
    269           'threading/simple_thread.cc',
    270           'threading/simple_thread.h',
    271           'threading/thread.cc',
    272           'threading/thread.h',
    273           'threading/thread_checker.h',
    274           'threading/thread_checker_impl.cc',
    275           'threading/thread_checker_impl.h',
    276           'threading/thread_collision_warner.cc',
    277           'threading/thread_collision_warner.h',
    278           'threading/thread_local.h',
    279           'threading/thread_local_posix.cc',
    280           'threading/thread_local_storage.h',
    281           'threading/thread_local_storage_posix.cc',
    282           'threading/thread_local_storage_win.cc',
    283           'threading/thread_local_win.cc',
    284           'threading/thread_restrictions.h',
    285           'threading/thread_restrictions.cc',
    286           'threading/watchdog.cc',
    287           'threading/watchdog.h',
    288           'threading/worker_pool.h',
    289           'threading/worker_pool_posix.cc',
    290           'threading/worker_pool_posix.h',
    291           'threading/worker_pool_win.cc',
    292           'time.cc',
    293           'time.h',
    294           'time_win.cc',
    295           'timer.cc',
    296           'timer.h',
    297           'tracked.cc',
    298           'tracked.h',
    299           'tracked_objects.cc',
    300           'tracked_objects.h',
    301           'tuple.h',
    302           'utf_offset_string_conversions.cc',
    303           'utf_offset_string_conversions.h',
    304           'utf_string_conversion_utils.cc',
    305           'utf_string_conversion_utils.h',
    306           'utf_string_conversions.cc',
    307           'utf_string_conversions.h',
    308           'values.cc',
    309           'values.h',
    310           'value_conversions.cc',
    311           'value_conversions.h',
    312           'version.cc',
    313           'version.h',
    314           'vlog.cc',
    315           'vlog.h',
    316           'win/event_trace_consumer.h',
    317           'win/event_trace_controller.cc',
    318           'win/event_trace_controller.h',
    319           'win/event_trace_provider.cc',
    320           'win/event_trace_provider.h',
    321           'win/i18n.cc',
    322           'win/i18n.h',
    323           'win/object_watcher.cc',
    324           'win/object_watcher.h',
    325           'win/registry.cc',
    326           'win/registry.h',
    327           'win/scoped_bstr.cc',
    328           'win/scoped_bstr.h',
    329           'win/scoped_comptr.h',
    330           'win/scoped_gdi_object.h',
    331           'win/scoped_handle.h',
    332           'win/scoped_hdc.h',
    333           'win/scoped_hglobal.h',
    334           'win/scoped_variant.cc',
    335           'win/scoped_variant.h',
    336           'win/win_util.cc',
    337           'win/win_util.h',
    338           'win/windows_version.cc',
    339           'win/windows_version.h',
    340           'win/wrapped_window_proc.cc',
    341           'win/wrapped_window_proc.h',
    342           'nix/xdg_util.h',
    343           'nix/xdg_util.cc',
    344         ],
    345         'include_dirs': [
    346           '..',
    347         ],
    348         # These warnings are needed for the files in third_party\dmg_fp.
    349         'msvs_disabled_warnings': [
    350           4244, 4554, 4018, 4102,
    351         ],
    352         'mac_framework_dirs': [
    353           '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks',
    354         ],
    355         'conditions': [
    356           [ 'OS != "linux" and OS != "freebsd" and OS != "openbsd" and OS != "solaris"', {
    357               'sources/': [
    358                 ['exclude', '^nix/'],
    359               ],
    360               'sources!': [
    361                 'atomicops_internals_x86_gcc.cc',
    362                 'message_pump_glib.cc',
    363                 'message_pump_glib_x.cc',
    364               ],
    365           }],
    366           [ 'OS != "linux"', {
    367               'sources!': [
    368                 # Not automatically excluded by the *linux.cc rules.
    369                 'gtk_util.cc',
    370                 'gtk_util.h',
    371                 'linux_util.cc',
    372               ],
    373             },
    374           ],
    375           [ 'OS != "mac"', {
    376               'sources!': [
    377                 'scoped_aedesc.h'
    378               ],
    379           }],
    380           # For now, just test the *BSD platforms enough to exclude them.
    381           # Subsequent changes will include them further.
    382           [ 'OS != "freebsd"', {
    383               'sources/': [ ['exclude', '_freebsd\\.cc$'] ],
    384             },
    385           ],
    386           [ 'OS != "openbsd"', {
    387               'sources/': [ ['exclude', '_openbsd\\.cc$'] ],
    388             },
    389           ],
    390           ['OS != "win"', {
    391               'sources/': [ ['exclude', '^win/'] ],
    392             },
    393           ],
    394           [ 'OS == "win"', {
    395             'include_dirs': [
    396               '<(DEPTH)/third_party/wtl/include',
    397             ],
    398             'sources!': [
    399               'event_recorder_stubs.cc',
    400               'file_descriptor_shuffle.cc',
    401               'message_pump_libevent.cc',
    402               # Not using sha1_win.cc because it may have caused a
    403               # regression to page cycler moz.
    404               'sha1_win.cc',
    405               'string16.cc',
    406               'debug/trace_event.cc',
    407             ],
    408           },],
    409           ['OS=="freebsd" or OS=="openbsd"', {
    410             'sources!': [
    411               'base/files/file_path_watcher_linux.cc',
    412             ],
    413             'sources': [
    414               'base/files/file_path_watcher_stub.cc',
    415             ],
    416           }],
    417         ],
    418       }],
    419     ],
    420   },
    421   'targets': [
    422     {
    423       'target_name': 'base',
    424       'type': '<(library)',
    425       'msvs_guid': '1832A374-8A74-4F9E-B536-69A699B3E165',
    426       'variables': {
    427         'base_target': 1,
    428       },
    429       'dependencies': [
    430         'base_static',
    431         '../third_party/modp_b64/modp_b64.gyp:modp_b64',
    432         'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
    433       ],
    434       # TODO(gregoryd): direct_dependent_settings should be shared with the
    435       #  64-bit target, but it doesn't work due to a bug in gyp
    436       'direct_dependent_settings': {
    437         'include_dirs': [
    438           '..',
    439         ],
    440       },
    441       'conditions': [
    442         [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {
    443           'conditions': [
    444             [ 'chromeos==1', {
    445                 'sources/': [ ['include', '_chromeos\\.cc$'] ]
    446               },
    447             ],
    448             [ 'linux_use_tcmalloc==0', {
    449                 'defines': [
    450                   'NO_TCMALLOC',
    451                 ],
    452                 'direct_dependent_settings': {
    453                   'defines': [
    454                     'NO_TCMALLOC',
    455                   ],
    456                 },
    457               },
    458             ],
    459           ],
    460           'dependencies': [
    461             'symbolize',
    462             '../build/util/build_util.gyp:lastchange',
    463             '../build/linux/system.gyp:gtk',
    464             '../build/linux/system.gyp:x11',
    465             'xdg_mime',
    466           ],
    467           'defines': [
    468             'USE_SYMBOLIZE',
    469           ],
    470           'cflags': [
    471             '-Wno-write-strings',
    472           ],
    473           'export_dependent_settings': [
    474             '../build/linux/system.gyp:gtk',
    475             '../build/linux/system.gyp:x11',
    476           ],
    477         }, {  # OS != "linux" and OS != "freebsd" and OS != "openbsd" and OS != "solaris"
    478             'sources/': [
    479               ['exclude', '/xdg_user_dirs/'],
    480               ['exclude', '_nss\.cc$'],
    481             ],
    482         }],
    483         [ 'OS == "freebsd" or OS == "openbsd"', {
    484           'link_settings': {
    485             'libraries': [
    486               '-L/usr/local/lib -lexecinfo',
    487               ],
    488             },
    489           },
    490         ],
    491         [ 'OS == "linux"', {
    492           'link_settings': {
    493              'libraries': [
    494              # We need rt for clock_gettime().
    495              '-lrt',
    496              # For 'native_library_linux.cc'
    497              '-ldl',
    498            ],
    499          },
    500         }],
    501         [ 'OS == "mac"', {
    502           'link_settings': {
    503             'libraries': [
    504               '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
    505               '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
    506               '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
    507               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
    508               '$(SDKROOT)/System/Library/Frameworks/IOKit.framework',
    509               '$(SDKROOT)/System/Library/Frameworks/Security.framework',
    510             ],
    511           },
    512         }],
    513         [ 'OS != "win"', {
    514             'dependencies': ['../third_party/libevent/libevent.gyp:libevent'],
    515             'sources!': [
    516               'third_party/purify/pure_api.c',
    517               'base_drag_source.cc',
    518               'base_drop_target.cc',
    519               'event_recorder.cc',
    520               'file_version_info.cc',
    521               'registry.cc',
    522               'resource_util.cc',
    523               'win_util.cc',
    524             ],
    525         },],
    526       ],
    527       'sources': [
    528         'third_party/nspr/prcpucfg.h',
    529         'third_party/nspr/prcpucfg_win.h',
    530         'third_party/nspr/prtypes.h',
    531         'third_party/purify/pure.h',
    532         'third_party/purify/pure_api.c',
    533         'third_party/xdg_user_dirs/xdg_user_dir_lookup.cc',
    534         'third_party/xdg_user_dirs/xdg_user_dir_lookup.h',
    535         'auto_reset.h',
    536         'base64.cc',
    537         'base64.h',
    538         'event_recorder.cc',
    539         'event_recorder.h',
    540         'event_recorder_stubs.cc',
    541         'file_descriptor_shuffle.cc',
    542         'file_descriptor_shuffle.h',
    543         'linux_util.cc',
    544         'linux_util.h',
    545         'md5.cc',
    546         'md5.h',
    547         'message_pump_glib.cc',
    548         'message_pump_glib.h',
    549         'message_pump_glib_x.cc',
    550         'message_pump_glib_x.h',
    551         'message_pump_glib_x_dispatch.h',
    552         'message_pump_libevent.cc',
    553         'message_pump_libevent.h',
    554         'message_pump_mac.h',
    555         'message_pump_mac.mm',
    556         'metrics/field_trial.cc',
    557         'metrics/field_trial.h',
    558         'string16.cc',
    559         'string16.h',
    560         'sync_socket.h',
    561         'sync_socket_win.cc',
    562         'sync_socket_posix.cc',
    563         'time_mac.cc',
    564         'time_posix.cc',
    565       ],
    566     },
    567   ],
    568   'conditions': [
    569     [ 'OS == "win"', {
    570       'targets': [
    571         {
    572           'target_name': 'base_nacl_win64',
    573           'type': '<(library)',
    574           'msvs_guid': 'CEE1F794-DC70-4FED-B7C4-4C12986672FE',
    575           'variables': {
    576             'base_target': 1,
    577           },
    578           'dependencies': [
    579             'base_static_win64',
    580             'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
    581           ],
    582           # TODO(gregoryd): direct_dependent_settings should be shared with the
    583           # 32-bit target, but it doesn't work due to a bug in gyp
    584           'direct_dependent_settings': {
    585             'include_dirs': [
    586               '..',
    587             ],
    588           },
    589           'defines': [
    590             '<@(nacl_win64_defines)',
    591           ],
    592           'sources': [
    593             'i18n/icu_util_nacl_win64.cc',
    594           ],
    595           'configurations': {
    596             'Common_Base': {
    597               'msvs_target_platform': 'x64',
    598             },
    599           },
    600         },
    601       ],
    602     }],
    603     [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {
    604       'targets': [
    605         {
    606           'target_name': 'symbolize',
    607           'type': '<(library)',
    608           'variables': {
    609             'chromium_code': 0,
    610           },
    611           'conditions': [
    612             [ 'OS == "solaris"', {
    613               'include_dirs': [
    614                 '/usr/gnu/include',
    615                 '/usr/gnu/include/libelf',
    616               ],
    617             },],
    618           ],
    619           'cflags': [
    620             '-Wno-sign-compare',
    621           ],
    622           'cflags!': [
    623             '-Wextra',
    624           ],
    625           'sources': [
    626             'third_party/symbolize/symbolize.cc',
    627             'third_party/symbolize/demangle.cc',
    628           ],
    629         },
    630         {
    631           'target_name': 'xdg_mime',
    632           'type': '<(library)',
    633           'variables': {
    634             'chromium_code': 0,
    635           },
    636           'cflags!': [
    637             '-Wextra',
    638           ],
    639           'sources': [
    640             'third_party/xdg_mime/xdgmime.c',
    641             'third_party/xdg_mime/xdgmime.h',
    642             'third_party/xdg_mime/xdgmimealias.c',
    643             'third_party/xdg_mime/xdgmimealias.h',
    644             'third_party/xdg_mime/xdgmimecache.c',
    645             'third_party/xdg_mime/xdgmimecache.h',
    646             'third_party/xdg_mime/xdgmimeglob.c',
    647             'third_party/xdg_mime/xdgmimeglob.h',
    648             'third_party/xdg_mime/xdgmimeicon.c',
    649             'third_party/xdg_mime/xdgmimeicon.h',
    650             'third_party/xdg_mime/xdgmimeint.c',
    651             'third_party/xdg_mime/xdgmimeint.h',
    652             'third_party/xdg_mime/xdgmimemagic.c',
    653             'third_party/xdg_mime/xdgmimemagic.h',
    654             'third_party/xdg_mime/xdgmimeparent.c',
    655             'third_party/xdg_mime/xdgmimeparent.h',
    656           ],
    657         },
    658       ],
    659     }],
    660   ],
    661 }
    662