Home | History | Annotate | Download | only in chrome
      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   'conditions': [
      6     ['OS=="mac" or OS=="win"', {
      7       'targets': [
      8         {
      9           'target_name': 'chrome_dll',
     10           'type': 'none',
     11           'dependencies': [
     12             'chrome_main_dll',
     13           ],
     14           'conditions': [
     15             ['OS=="mac" and component=="shared_library"', {
     16               'type': 'shared_library',
     17               'includes': [ 'chrome_dll_bundle.gypi' ],
     18               'xcode_settings': {
     19                 'OTHER_LDFLAGS': [
     20                   '-Wl,-reexport_library,<(PRODUCT_DIR)/libchrome_main_dll.dylib',
     21                 ],
     22               },
     23             }],  # OS=="mac"
     24             ['chrome_multiple_dll==1', {
     25               'dependencies': [
     26                 'chrome_child_dll',
     27               ],
     28             }],
     29             ['incremental_chrome_dll==1', {
     30               # Linking to a different directory and then hardlinking back
     31               # to OutDir is a workaround to avoid having the .ilk for
     32               # chrome.exe and chrome.dll conflicting. See crbug.com/92528
     33               # for more information. Done on the dll instead of the exe so
     34               # that people launching from VS don't need to modify
     35               # $(TargetPath) for the exe.
     36               'actions': [
     37                 {
     38                   'action_name': 'hardlink_to_output',
     39                   'inputs': [
     40                     '$(OutDir)\\initial\\chrome.dll',
     41                   ],
     42                   'outputs': [
     43                     '$(OutDir)\\chrome.dll',
     44                   ],
     45                   'action': ['tools\\build\\win\\hardlink_failsafe.bat',
     46                              '$(OutDir)\\initial\\chrome.dll',
     47                              '$(OutDir)\\chrome.dll'],
     48                   'msvs_cygwin_shell': 0,
     49                 },
     50               ],
     51               'conditions': [
     52                 # Only hardlink pdb if we're generating debug info.
     53                 ['fastbuild==0 or win_z7!=0', {
     54                   'actions': [
     55                     {
     56                       'action_name': 'hardlink_pdb_to_output',
     57                       'inputs': [
     58                         # Not the pdb, since gyp doesn't know about it
     59                         '$(OutDir)\\initial\\chrome.dll',
     60                       ],
     61                       'outputs': [
     62                         '$(OutDir)\\chrome.dll.pdb',
     63                       ],
     64                       'action': ['tools\\build\\win\\hardlink_failsafe.bat',
     65                                  '$(OutDir)\\initial\\chrome.dll.pdb',
     66                                  '$(OutDir)\\chrome.dll.pdb'],
     67                       'msvs_cygwin_shell': 0,
     68                     }
     69                   ]
     70                 }]
     71               ],
     72             }],
     73           ]
     74         },
     75         {
     76           'target_name': 'chrome_main_dll',
     77           'type': 'shared_library',
     78           'variables': {
     79             'enable_wexit_time_destructors': 1,
     80           },
     81           'dependencies': [
     82             '<@(chromium_browser_dependencies)',
     83             '../content/content.gyp:content_app_browser',
     84             'app/policy/cloud_policy_codegen.gyp:policy',
     85           ],
     86           'conditions': [
     87             ['use_aura==1', {
     88               'dependencies': [
     89                 '../ui/compositor/compositor.gyp:compositor',
     90               ],
     91             }],
     92             ['OS=="win" and target_arch=="ia32"', {
     93               # Add a dependency to custom import library for user32 delay
     94               # imports only in x86 builds.
     95               'dependencies': [
     96                 'chrome_user32_delay_imports',
     97               ],
     98             },],
     99             ['OS=="win"', {
    100               'product_name': 'chrome',
    101               'dependencies': [
    102                 # On Windows, link the dependencies (libraries) that make
    103                 # up actual Chromium functionality into this .dll.
    104                 'chrome_dll_pdb_workaround',
    105                 'chrome_resources.gyp:chrome_resources',
    106                 'chrome_version_resources',
    107                 '../chrome/chrome_resources.gyp:chrome_unscaled_resources',
    108                 '../crypto/crypto.gyp:crypto',
    109                 '../printing/printing.gyp:printing',
    110                 '../net/net.gyp:net_resources',
    111                 '../third_party/cld/cld.gyp:cld',
    112                 '../ui/views/views.gyp:views',
    113                 '../webkit/webkit_resources.gyp:webkit_resources',
    114               ],
    115               'sources': [
    116                 'app/chrome_command_ids.h',
    117                 'app/chrome_dll.rc',
    118                 'app/chrome_dll_resource.h',
    119                 'app/chrome_main.cc',
    120                 'app/chrome_main_delegate.cc',
    121                 'app/chrome_main_delegate.h',
    122                 'app/delay_load_hook_win.cc',
    123                 'app/delay_load_hook_win.h',
    124 
    125                 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
    126                 '../base/win/dllmain.cc',
    127 
    128                 '../ui/resources/cursors/aliasb.cur',
    129                 '../ui/resources/cursors/cell.cur',
    130                 '../ui/resources/cursors/col_resize.cur',
    131                 '../ui/resources/cursors/copy.cur',
    132                 '../ui/resources/cursors/none.cur',
    133                 '../ui/resources/cursors/row_resize.cur',
    134                 '../ui/resources/cursors/vertical_text.cur',
    135                 '../ui/resources/cursors/zoom_in.cur',
    136                 '../ui/resources/cursors/zoom_out.cur',
    137 
    138                 # TODO:  It would be nice to have these pulled in
    139                 # automatically from direct_dependent_settings in
    140                 # their various targets (net.gyp:net_resources, etc.),
    141                 # but that causes errors in other targets when
    142                 # resulting .res files get referenced multiple times.
    143                 '<(SHARED_INTERMEDIATE_DIR)/chrome/browser_resources.rc',
    144                 '<(SHARED_INTERMEDIATE_DIR)/chrome/chrome_unscaled_resources.rc',
    145                 '<(SHARED_INTERMEDIATE_DIR)/chrome/common_resources.rc',
    146                 '<(SHARED_INTERMEDIATE_DIR)/chrome/extensions_api_resources.rc',
    147                 '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.rc',
    148                 '<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.rc',
    149                 '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
    150                 '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_unscaled_resources.rc',
    151                 '<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.rc',
    152               ],
    153               'include_dirs': [
    154                 '<(DEPTH)/third_party/wtl/include',
    155               ],
    156               'configurations': {
    157                 'Debug_Base': {
    158                   'msvs_settings': {
    159                     'VCLinkerTool': {
    160                       'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
    161                     },
    162                   },
    163                 },
    164               },
    165               'msvs_settings': {
    166                 'VCLinkerTool': {
    167                   'BaseAddress': '0x01c30000',
    168                   'ImportLibrary': '$(OutDir)\\lib\\chrome_dll.lib',
    169                   # Set /SUBSYSTEM:WINDOWS for chrome.dll (for consistency).
    170                   'SubSystem': '2',
    171                   'conditions': [
    172                     ['incremental_chrome_dll==1', {
    173                       'OutputFile': '$(OutDir)\\initial\\chrome.dll',
    174                       'UseLibraryDependencyInputs': "true",
    175                     }],
    176                     ['target_arch=="ia32"', {
    177                       # Link against the XP-constrained user32 import library
    178                       # instead of the platform-SDK provided one to avoid
    179                       # inadvertently taking dependencies on post-XP user32
    180                       # exports.
    181                       'AdditionalDependencies!': [
    182                         'user32.lib',
    183                       ],
    184                       'IgnoreDefaultLibraryNames': [
    185                         'user32.lib',
    186                       ],
    187                       # Remove user32 delay load for chrome.dll.
    188                       'DelayLoadDLLs!': [
    189                         'user32.dll',
    190                       ],
    191                       'AdditionalDependencies': [
    192                         'user32.winxp.lib',
    193                       ],
    194                       'DelayLoadDLLs': [
    195                         'user32-delay.dll',
    196                       ],
    197                       'AdditionalLibraryDirectories': [
    198                         '<(DEPTH)/build/win/importlibs/x86',
    199                       ],
    200                       'ForceSymbolReferences': [
    201                         # Force the inclusion of the delay load hook in this
    202                         # binary.
    203                         '_ChromeDelayLoadHook@8',
    204                       ],
    205                     }],
    206                   ],
    207                   'DelayLoadDLLs': [
    208                     'comdlg32.dll',
    209                     'crypt32.dll',
    210                     'cryptui.dll',
    211                     'dhcpcsvc.dll',
    212                     'imagehlp.dll',
    213                     'imm32.dll',
    214                     'iphlpapi.dll',
    215                     'setupapi.dll',
    216                     'urlmon.dll',
    217                     'winhttp.dll',
    218                     'wininet.dll',
    219                     'winspool.drv',
    220                     'ws2_32.dll',
    221                     'wsock32.dll',
    222                   ],
    223                 },
    224                 'VCManifestTool': {
    225                   'AdditionalManifestFiles': [
    226                     '$(ProjectDir)\\app\\chrome.dll.manifest',
    227                   ],
    228                 },
    229               },
    230               'conditions': [
    231                 ['win_use_allocator_shim==1', {
    232                   'dependencies': [
    233                     '<(allocator_target)',
    234                   ],
    235                 }],
    236               ]
    237             }],
    238             ['chrome_multiple_dll==1', {
    239               'defines': [
    240                 'CHROME_MULTIPLE_DLL_BROWSER',
    241               ],
    242             }, {
    243               'dependencies': [
    244                 '<@(chromium_child_dependencies)',
    245                 '../content/content.gyp:content_app_both',
    246                 '../content/content.gyp:content_worker',
    247               ],
    248               'dependencies!': [
    249                 '../content/content.gyp:content_app_browser',
    250               ],
    251             }],
    252             ['OS=="mac" and component!="shared_library"', {
    253               'includes': [ 'chrome_dll_bundle.gypi' ],
    254             }],
    255             ['OS=="mac" and component=="shared_library"', {
    256               'xcode_settings': { 'OTHER_LDFLAGS': [ '-Wl,-ObjC' ], },
    257             }],
    258             ['OS=="mac"', {
    259               'xcode_settings': {
    260                 # Define the order of symbols within the framework.  This
    261                 # sets -order_file.
    262                 'ORDER_FILE': 'app/framework.order',
    263               },
    264               'sources': [
    265                 'app/chrome_command_ids.h',
    266                 'app/chrome_dll_resource.h',
    267                 'app/chrome_main.cc',
    268                 'app/chrome_main_delegate.cc',
    269                 'app/chrome_main_delegate.h',
    270                 'app/chrome_main_mac.mm',
    271                 'app/chrome_main_mac.h',
    272               ],
    273               'include_dirs': [
    274                 '<(grit_out_dir)',
    275               ],
    276               'postbuilds': [
    277                 {
    278                   # This step causes an error to be raised if the .order file
    279                   # does not account for all global text symbols.  It
    280                   # validates the completeness of the .order file.
    281                   'postbuild_name': 'Verify global text symbol order',
    282                   'variables': {
    283                     'verify_order_path': 'tools/build/mac/verify_order',
    284                   },
    285                   'action': [
    286                     '<(verify_order_path)',
    287                     '_ChromeMain',
    288                     '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}',
    289                   ],
    290                 },
    291               ],
    292               'conditions': [
    293                 ['mac_breakpad_compiled_in==1', {
    294                   'dependencies': [
    295                     '../breakpad/breakpad.gyp:breakpad',
    296                     '../components/components.gyp:breakpad_component',
    297                     'app/policy/cloud_policy_codegen.gyp:policy',
    298                   ],
    299                   'sources': [
    300                     'app/breakpad_mac.mm',
    301                     'app/breakpad_mac.h',
    302                     'app/chrome_breakpad_client.cc',
    303                     'app/chrome_breakpad_client.h',
    304                     'app/chrome_breakpad_client_mac.mm',
    305                   ],
    306                 }, {  # else: mac_breakpad_compiled_in!=1
    307                   # No Breakpad, put in the stubs.
    308                   'dependencies': [
    309                     '../components/components.gyp:breakpad_stubs',
    310                   ],
    311                   'sources': [
    312                     'app/breakpad_mac_stubs.mm',
    313                     'app/breakpad_mac.h',
    314                   ],
    315                 }],  # mac_breakpad_compiled_in
    316                 ['internal_pdf', {
    317                   'dependencies': [
    318                     '../pdf/pdf.gyp:pdf',
    319                   ],
    320                 }],
    321               ],  # conditions
    322             }],  # OS=="mac"
    323           ],  # conditions
    324         },  # target chrome_main_dll
    325       ],  # targets
    326     }],  # OS=="mac" or OS=="win"
    327     ['OS=="win"', {
    328       'targets': [
    329         {
    330           # This target is only depended upon on Windows.
    331           'target_name': 'chrome_dll_pdb_workaround',
    332           'type': 'static_library',
    333           'sources': [ 'empty_pdb_workaround.cc' ],
    334           'conditions': [
    335             ['fastbuild==0 or win_z7!=0', {
    336              'msvs_settings': {
    337               'VCCLCompilerTool': {
    338                 # This *in the compile phase* must match the pdb name that's
    339                 # output by the final link. See empty_pdb_workaround.cc for
    340                 # more details.
    341                 'DebugInformationFormat': '3',
    342                 'ProgramDataBaseFileName': '<(PRODUCT_DIR)/chrome.dll.pdb',
    343               },
    344              },
    345             }],
    346           ],
    347         },
    348       ],
    349     }],
    350     ['chrome_multiple_dll', {
    351       'targets': [
    352         {
    353           'target_name': 'chrome_child_dll',
    354           'type': 'shared_library',
    355           'product_name': 'chrome_child',
    356           'variables': {
    357             'enable_wexit_time_destructors': 1,
    358           },
    359           'dependencies': [
    360             '<@(chromium_child_dependencies)',
    361             '../content/content.gyp:content_app_child',
    362             '../content/content.gyp:content_worker',
    363             'chrome_version_resources',
    364             'policy_path_parser',
    365           ],
    366           'defines': [
    367             'CHROME_MULTIPLE_DLL_CHILD',
    368           ],
    369           'sources': [
    370             '<(SHARED_INTERMEDIATE_DIR)/chrome/common_resources.rc',
    371             '<(SHARED_INTERMEDIATE_DIR)/chrome/extensions_api_resources.rc',
    372             '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
    373             'app/chrome_main.cc',
    374             'app/chrome_main_delegate.cc',
    375             'app/chrome_main_delegate.h',
    376           ],
    377         },  # target chrome_child_dll
    378       ],
    379     }],
    380   ],
    381 }
    382