Home | History | Annotate | Download | only in components
      1 # Copyright 2013 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     'nacl/nacl_defines.gypi',
     11   ],
     12   'target_defaults': {
     13     'variables': {
     14       'nacl_target': 0,
     15     },
     16     'target_conditions': [
     17       # This part is shared between the targets defined below. Only files and
     18       # settings relevant for building the Win64 target should be added here.
     19       ['nacl_target==1', {
     20         'include_dirs': [
     21           '<(INTERMEDIATE_DIR)',
     22         ],
     23         'defines': [
     24           '<@(nacl_defines)',
     25         ],
     26         'sources': [
     27           # .cc, .h, and .mm files under nacl that are used on all
     28           # platforms, including both 32-bit and 64-bit Windows.
     29           # Test files are also not included.
     30           'nacl/loader/nacl_ipc_adapter.cc',
     31           'nacl/loader/nacl_ipc_adapter.h',
     32           'nacl/loader/nacl_main.cc',
     33           'nacl/loader/nacl_main_platform_delegate.h',
     34           'nacl/loader/nacl_main_platform_delegate_linux.cc',
     35           'nacl/loader/nacl_main_platform_delegate_mac.mm',
     36           'nacl/loader/nacl_main_platform_delegate_win.cc',
     37           'nacl/loader/nacl_listener.cc',
     38           'nacl/loader/nacl_listener.h',
     39           'nacl/loader/nacl_validation_db.h',
     40           'nacl/loader/nacl_validation_query.cc',
     41           'nacl/loader/nacl_validation_query.h',
     42         ],
     43         # TODO(gregoryd): consider switching NaCl to use Chrome OS defines
     44         'conditions': [
     45           ['OS=="win"', {
     46             'defines': [
     47               '__STDC_LIMIT_MACROS=1',
     48             ],
     49             'include_dirs': [
     50               '<(DEPTH)/third_party/wtl/include',
     51             ],
     52           },],
     53           ['OS=="linux"', {
     54             'defines': [
     55               '__STDC_LIMIT_MACROS=1',
     56             ],
     57             'sources': [
     58               '../components/nacl/common/nacl_paths.cc',
     59               '../components/nacl/common/nacl_paths.h',
     60               '../components/nacl/zygote/nacl_fork_delegate_linux.cc',
     61               '../components/nacl/zygote/nacl_fork_delegate_linux.h',
     62             ],
     63           },],
     64         ],
     65       }],
     66     ],
     67   },
     68   'conditions': [
     69     ['disable_nacl!=1', {
     70       'targets': [
     71         {
     72           'target_name': 'nacl',
     73           'type': 'static_library',
     74           'variables': {
     75             'nacl_target': 1,
     76           },
     77           'dependencies': [
     78             '../base/base.gyp:base',
     79             '../ipc/ipc.gyp:ipc',
     80             '../ppapi/native_client/src/trusted/plugin/plugin.gyp:ppGoogleNaClPluginChrome',
     81             '../ppapi/ppapi_internal.gyp:ppapi_shared',
     82             '../ppapi/ppapi_internal.gyp:ppapi_ipc',
     83             '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome',
     84           ],
     85           'conditions': [
     86             ['disable_nacl_untrusted==0', {
     87               'dependencies': [
     88                 '../ppapi/native_client/native_client.gyp:nacl_irt',
     89                 '../ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:pnacl_irt_shim',
     90                 '../ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_support_extension.gyp:pnacl_support_extension',
     91               ],
     92             }],
     93           ],
     94           'direct_dependent_settings': {
     95             'defines': [
     96               '<@(nacl_defines)',
     97             ],
     98           },
     99         },
    100         {
    101           'target_name': 'nacl_browser',
    102           'type': 'static_library',
    103           'sources': [
    104             'nacl/browser/nacl_broker_host_win.cc',
    105             'nacl/browser/nacl_broker_host_win.h',
    106             'nacl/browser/nacl_broker_service_win.cc',
    107             'nacl/browser/nacl_broker_service_win.h',
    108             'nacl/browser/nacl_browser.cc',
    109             'nacl/browser/nacl_browser.h',
    110             'nacl/browser/nacl_file_host.cc',
    111             'nacl/browser/nacl_file_host.h',
    112             'nacl/browser/nacl_host_message_filter.cc',
    113             'nacl/browser/nacl_host_message_filter.h',
    114             'nacl/browser/nacl_process_host.cc',
    115             'nacl/browser/nacl_process_host.h',
    116             'nacl/browser/nacl_validation_cache.cc',
    117             'nacl/browser/nacl_validation_cache.h',
    118             'nacl/browser/pnacl_host.cc',
    119             'nacl/browser/pnacl_host.h',
    120             'nacl/browser/pnacl_translation_cache.cc',
    121             'nacl/browser/pnacl_translation_cache.h',
    122             'nacl/common/nacl_debug_exception_handler_win.cc',
    123             'nacl/common/nacl_debug_exception_handler_win.h',
    124           ],
    125           'include_dirs': [
    126             '..',
    127           ],
    128           'dependencies': [
    129             'nacl_common',
    130             'nacl_switches',
    131             '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel',
    132             '../content/content.gyp:content_browser',
    133           ],
    134           'defines': [
    135             '<@(nacl_defines)',
    136           ],
    137           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
    138           'msvs_disabled_warnings': [4267, ],
    139         },
    140         {
    141           'target_name': 'nacl_renderer',
    142           'type': 'static_library',
    143           'sources': [
    144             'nacl/renderer/pnacl_translation_resource_host.cc',
    145             'nacl/renderer/pnacl_translation_resource_host.h',
    146             'nacl/renderer/ppb_nacl_private_impl.cc',
    147             'nacl/renderer/ppb_nacl_private_impl.h',
    148           ],
    149           'include_dirs': [
    150             '..',
    151           ],
    152           'dependencies': [
    153             '../content/content.gyp:content_renderer',
    154             '../webkit/common/webkit_common.gyp:webkit_common',
    155           ],
    156           'defines': [
    157             '<@(nacl_defines)',
    158           ],
    159           'direct_dependent_settings': {
    160             'defines': [
    161               '<@(nacl_defines)',
    162             ],
    163           },
    164         }
    165       ],
    166       'conditions': [
    167         ['OS=="linux"', {
    168           'targets': [
    169             {
    170               'target_name': 'nacl_helper',
    171               'type': 'executable',
    172               'include_dirs': [
    173                 '..',
    174               ],
    175               'dependencies': [
    176                 'nacl',
    177                 'nacl_common',
    178                 '../crypto/crypto.gyp:crypto',
    179                 '../sandbox/sandbox.gyp:libc_urandom_override',
    180                 '../sandbox/sandbox.gyp:sandbox',
    181               ],
    182               'defines': [
    183                 '<@(nacl_defines)',
    184                 # Allow .cc files to know if they're being compiled as part
    185                 # of nacl_helper.
    186                 'IN_NACL_HELPER=1',
    187               ],
    188               'sources': [
    189                 'nacl/loader/nacl_sandbox_linux.cc',
    190                 'nacl/loader/nacl_helper_linux.cc',
    191                 'nacl/loader/nacl_helper_linux.h',
    192                 '../base/posix/unix_domain_socket_linux.cc',
    193                 '../content/common/child_process_sandbox_support_impl_shm_linux.cc',
    194                 '../content/common/sandbox_linux/sandbox_bpf_base_policy_linux.cc',
    195                 '../content/common/sandbox_linux/sandbox_init_linux.cc',
    196                 '../content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc',
    197                 '../content/public/common/content_switches.cc',
    198               ],
    199               'conditions': [
    200                 ['toolkit_uses_gtk == 1', {
    201                   'dependencies': [
    202                     '../build/linux/system.gyp:gtk',
    203                   ],
    204                 }],
    205                 ['use_glib == 1', {
    206                   'dependencies': [
    207                     '../build/linux/system.gyp:glib',
    208                   ],
    209                 }],
    210                 ['os_posix == 1 and OS != "mac"', {
    211                   'conditions': [
    212                     ['linux_use_tcmalloc==1', {
    213                       'dependencies': [
    214                         '../base/allocator/allocator.gyp:allocator',
    215                       ],
    216                     }],
    217                   ],
    218                 }],
    219               ],
    220               'cflags': ['-fPIE'],
    221               'link_settings': {
    222                 'ldflags': ['-pie'],
    223               },
    224             },
    225           ],
    226         }],
    227         ['OS=="win" and target_arch=="ia32"', {
    228           'targets': [
    229             {
    230               'target_name': 'nacl_win64',
    231               'type': 'static_library',
    232               'variables': {
    233                 'nacl_target': 1,
    234               },
    235               'dependencies': [
    236                 'nacl_common_win64',
    237                 '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome64',
    238                 '../ppapi/ppapi_internal.gyp:ppapi_shared_win64',
    239                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
    240               ],
    241               'export_dependent_settings': [
    242                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
    243               ],
    244               'sources': [
    245                 '../components/nacl/broker/nacl_broker_listener.cc',
    246                 '../components/nacl/broker/nacl_broker_listener.h',
    247                 '../components/nacl/common/nacl_debug_exception_handler_win.cc',
    248                 '../components/nacl/loader/nacl_helper_win_64.cc',
    249                 '../components/nacl/loader/nacl_helper_win_64.h',
    250               ],
    251               'include_dirs': [
    252                 '..',
    253               ],
    254               'defines': [
    255                 '<@(nacl_win64_defines)',
    256                 'COMPILE_CONTENT_STATICALLY',
    257               ],
    258               'configurations': {
    259                 'Common_Base': {
    260                   'msvs_target_platform': 'x64',
    261                 },
    262               },
    263               'direct_dependent_settings': {
    264                 'defines': [
    265                   '<@(nacl_defines)',
    266                 ],
    267               },
    268             },
    269             {
    270               'target_name': 'nacl_switches_win64',
    271               'type': 'static_library',
    272               'sources': [
    273                 'nacl/common/nacl_switches.cc',
    274                 'nacl/common/nacl_switches.h',
    275               ],
    276               'include_dirs': [
    277                 '..',
    278               ],
    279               'configurations': {
    280                 'Common_Base': {
    281                   'msvs_target_platform': 'x64',
    282                 },
    283               },
    284             },
    285             {
    286               'target_name': 'nacl_common_win64',
    287               'type': 'static_library',
    288               'defines': [
    289                 'COMPILE_CONTENT_STATICALLY',
    290               ],
    291               'sources': [
    292                 'nacl/common/nacl_cmd_line.cc',
    293                 'nacl/common/nacl_cmd_line.h',
    294                 'nacl/common/nacl_messages.cc',
    295                 'nacl/common/nacl_messages.h',
    296                 'nacl/common/nacl_types.cc',
    297                 'nacl/common/nacl_types.h',
    298               ],
    299               'include_dirs': [
    300                 '..',
    301               ],
    302               'configurations': {
    303                 'Common_Base': {
    304                   'msvs_target_platform': 'x64',
    305                 },
    306               },
    307             },
    308           ],
    309         }],
    310       ],
    311     }, {  # else (disable_nacl==1)
    312       'targets': [
    313         {
    314           'target_name': 'nacl',
    315           'type': 'none',
    316           'sources': [],
    317         },
    318       ],
    319       'conditions': [
    320         ['OS=="win"', {
    321           'targets': [
    322             {
    323               'target_name': 'nacl_win64',
    324               'type': 'none',
    325               'sources': [],
    326             },
    327             {
    328               'target_name': 'nacl_switches_win64',
    329               'type': 'none',
    330               'sources': [],
    331             },
    332           ],
    333         }],
    334       ],
    335     }],
    336   ],
    337   'targets': [
    338     {
    339       'target_name': 'nacl_switches',
    340       'type': 'static_library',
    341       'sources': [
    342         'nacl/common/nacl_switches.cc',
    343         'nacl/common/nacl_switches.h',
    344     ],
    345       'include_dirs': [
    346         '..',
    347       ],
    348     },
    349     {
    350       'target_name': 'nacl_common',
    351       'type': 'static_library',
    352       'sources': [
    353         'nacl/common/nacl_cmd_line.cc',
    354         'nacl/common/nacl_cmd_line.h',
    355         'nacl/common/nacl_host_messages.h',
    356         'nacl/common/nacl_host_messages.cc',
    357         'nacl/common/nacl_messages.cc',
    358         'nacl/common/nacl_messages.h',
    359         'nacl/common/nacl_process_type.h',
    360         'nacl/common/nacl_sandbox_type_mac.h',
    361         'nacl/common/nacl_types.cc',
    362         'nacl/common/nacl_types.h',
    363         'nacl/common/pnacl_types.cc',
    364         'nacl/common/pnacl_types.h',
    365       ],
    366       'include_dirs': [
    367         '..',
    368       ],
    369     },
    370   ]
    371 }
    372