Fix crash when JS alert from background page appears during lock screen
[chromium-blink-merge.git] / chrome / chrome_dll.gypi
blob9ed89d66ccac516913c9dd82b02efc076296c45f
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.
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             ['incremental_chrome_dll==1', {
25               # Linking to a different directory and then hardlinking back
26               # to OutDir is a workaround to avoid having the .ilk for
27               # chrome.exe and chrome.dll conflicting. See crbug.com/92528
28               # for more information. Done on the dll instead of the exe so
29               # that people launching from VS don't need to modify
30               # $(TargetPath) for the exe.
31               'actions': [
32                 {
33                   'action_name': 'hardlink_to_output',
34                   'inputs': [
35                     '$(OutDir)\\initial\\chrome.dll',
36                   ],
37                   'outputs': [
38                     '$(OutDir)\\chrome.dll',
39                   ],
40                   'action': ['tools\\build\\win\\hardlink_failsafe.bat',
41                              '$(OutDir)\\initial\\chrome.dll',
42                              '$(OutDir)\\chrome.dll'],
43                   'msvs_cygwin_shell': 0,
44                 },
45               ],
46               'conditions': [
47                 # Only hardlink pdb if we're generating debug info.
48                 ['fastbuild==0 or win_z7!=0', {
49                   'actions': [
50                     {
51                       'action_name': 'hardlink_pdb_to_output',
52                       'inputs': [
53                         # Not the pdb, since gyp doesn't know about it
54                         '$(OutDir)\\initial\\chrome.dll',
55                       ],
56                       'outputs': [
57                         '$(OutDir)\\chrome.dll.pdb',
58                       ],
59                       'action': ['tools\\build\\win\\hardlink_failsafe.bat',
60                                  '$(OutDir)\\initial\\chrome.dll.pdb',
61                                  '$(OutDir)\\chrome.dll.pdb'],
62                       'msvs_cygwin_shell': 0,
63                     }
64                   ]
65                 }]
66               ],
67             }],
68           ]
69         },
70         {
71           'target_name': 'chrome_main_dll',
72           'type': 'shared_library',
73           'variables': {
74             'enable_wexit_time_destructors': 1,
75           },
76           'dependencies': [
77             '<@(chromium_browser_dependencies)',
78             '<@(chromium_child_dependencies)',
79             '../content/content.gyp:content_worker',
80             'app/policy/cloud_policy_codegen.gyp:policy',
81           ],
82           'conditions': [
83             ['use_aura==1', {
84               'dependencies': [
85                 '../ui/compositor/compositor.gyp:compositor',
86               ],
87             }],
88             ['use_ash==1', {
89               'sources': [
90                 '<(SHARED_INTERMEDIATE_DIR)/ash/ash_resources/ash_wallpaper_resources.rc',
91               ],
92             }],
93             ['OS=="win" and target_arch=="ia32"', {
94               # Add a dependency to custom import library for user32 delay
95               # imports only in x86 builds.
96               'dependencies': [
97                 'chrome_user32_delay_imports',
98               ],
99             },],
100             ['OS=="win"', {
101               'product_name': 'chrome',
102               'dependencies': [
103                 # On Windows, link the dependencies (libraries) that make
104                 # up actual Chromium functionality into this .dll.
105                 'chrome_dll_pdb_workaround',
106                 'chrome_resources.gyp:chrome_resources',
107                 'chrome_version_resources',
108                 '../chrome/chrome_resources.gyp:chrome_unscaled_resources',
109                 '../crypto/crypto.gyp:crypto',
110                 '../printing/printing.gyp:printing',
111                 '../net/net.gyp:net_resources',
112                 '../third_party/cld/cld.gyp:cld',
113                 '../ui/views/views.gyp:views',
114                 '../webkit/support/webkit_support.gyp:webkit_resources',
115               ],
116               'sources': [
117                 'app/chrome_command_ids.h',
118                 'app/chrome_dll.rc',
119                 'app/chrome_dll_resource.h',
120                 'app/chrome_main.cc',
121                 'app/chrome_main_delegate.cc',
122                 'app/chrome_main_delegate.h',
123                 'app/delay_load_hook_win.cc',
124                 'app/delay_load_hook_win.h',
126                 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
127                 '../base/win/dllmain.cc',
129                 '../ui/resources/cursors/aliasb.cur',
130                 '../ui/resources/cursors/cell.cur',
131                 '../ui/resources/cursors/col_resize.cur',
132                 '../ui/resources/cursors/copy.cur',
133                 '../ui/resources/cursors/none.cur',
134                 '../ui/resources/cursors/row_resize.cur',
135                 '../ui/resources/cursors/vertical_text.cur',
136                 '../ui/resources/cursors/zoom_in.cur',
137                 '../ui/resources/cursors/zoom_out.cur',
139                 # TODO:  It would be nice to have these pulled in
140                 # automatically from direct_dependent_settings in
141                 # their various targets (net.gyp:net_resources, etc.),
142                 # but that causes errors in other targets when
143                 # resulting .res files get referenced multiple times.
144                 '<(SHARED_INTERMEDIATE_DIR)/chrome/browser_resources.rc',
145                 '<(SHARED_INTERMEDIATE_DIR)/chrome/chrome_unscaled_resources.rc',
146                 '<(SHARED_INTERMEDIATE_DIR)/chrome/common_resources.rc',
147                 '<(SHARED_INTERMEDIATE_DIR)/chrome/extensions_api_resources.rc',
148                 '<(SHARED_INTERMEDIATE_DIR)/content/content_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/webkit_chromium_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': '$(ProjectDir)\\app\\chrome.dll.manifest',
226                 },
227               },
228             }],  # OS=="win"
229             ['OS=="mac" and component!="shared_library"', {
230               'includes': [ 'chrome_dll_bundle.gypi' ],
231             }],
232             ['OS=="mac" and component=="shared_library"', {
233               'xcode_settings': { 'OTHER_LDFLAGS': [ '-Wl,-ObjC' ], },
234             }],
235             ['chrome_split_dll', {
236               'sources': [
237                 # See comment in .cc for explanation.
238                 'split_dll_fake_entry.cc',
239               ],
240               'msvs_settings': {
241                 'VCLinkerTool': {
242                   'AdditionalOptions': ['/splitlink'],
243                 },
244               }
245             }],
246             ['OS=="mac"', {
247               'xcode_settings': {
248                 # Define the order of symbols within the framework.  This
249                 # sets -order_file.
250                 'ORDER_FILE': 'app/framework.order',
251               },
252               'sources': [
253                 'app/chrome_command_ids.h',
254                 'app/chrome_dll_resource.h',
255                 'app/chrome_main.cc',
256                 'app/chrome_main_delegate.cc',
257                 'app/chrome_main_delegate.h',
258                 'app/chrome_main_app_mode_mac.mm',
259                 'app/chrome_main_mac.mm',
260                 'app/chrome_main_mac.h',
261               ],
262               'include_dirs': [
263                 '<(grit_out_dir)',
264               ],
265               'postbuilds': [
266                 {
267                   # This step causes an error to be raised if the .order file
268                   # does not account for all global text symbols.  It
269                   # validates the completeness of the .order file.
270                   'postbuild_name': 'Verify global text symbol order',
271                   'variables': {
272                     'verify_order_path': 'tools/build/mac/verify_order',
273                   },
274                   'action': [
275                     '<(verify_order_path)',
276                     '_ChromeMain',
277                     '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}',
278                   ],
279                 },
280               ],
281               'conditions': [
282                 ['mac_breakpad_compiled_in==1', {
283                   'dependencies': [
284                     '../breakpad/breakpad.gyp:breakpad',
285                     'app/policy/cloud_policy_codegen.gyp:policy',
286                   ],
287                   'sources': [
288                     'app/breakpad_mac.mm',
289                     'app/breakpad_mac.h',
290                   ],
291                 }, {  # else: mac_breakpad_compiled_in!=1
292                   # No Breakpad, put in the stubs.
293                   'sources': [
294                     'app/breakpad_mac_stubs.mm',
295                     'app/breakpad_mac.h',
296                   ],
297                 }],  # mac_breakpad_compiled_in
298                 ['internal_pdf', {
299                   'dependencies': [
300                     '../pdf/pdf.gyp:pdf',
301                   ],
302                 }],
303               ],  # conditions
304             }],  # OS=="mac"
305           ],  # conditions
306         },  # target chrome_main_dll
307       ],  # targets
308     }],  # OS=="mac" or OS=="win"
309     ['OS=="win"', {
310       'targets': [
311         {
312           # This target is only depended upon on Windows.
313           'target_name': 'chrome_dll_pdb_workaround',
314           'type': 'static_library',
315           'sources': [ 'empty_pdb_workaround.cc' ],
316           'conditions': [
317             ['fastbuild==0 or win_z7!=0', {
318              'msvs_settings': {
319               'VCCLCompilerTool': {
320                 # This *in the compile phase* must match the pdb name that's
321                 # output by the final link. See empty_pdb_workaround.cc for
322                 # more details.
323                 'DebugInformationFormat': '3',
324                 'ProgramDataBaseFileName': '<(PRODUCT_DIR)/chrome.dll.pdb',
325               },
326              },
327             }],
328           ],
329         },
330       ],
331     }],
332   ],