Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / chrome / chrome_dll.gypi
blobc082e884f089c16e8489030b44ea2db24b8729a4
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             ['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                 },
49               ],
50               'conditions': [
51                 # Only hardlink pdb if we're generating debug info.
52                 ['fastbuild==0 or win_z7!=0', {
53                   'actions': [
54                     {
55                       'action_name': 'hardlink_pdb_to_output',
56                       'inputs': [
57                         # Not the pdb, since gyp doesn't know about it
58                         '$(OutDir)\\initial\\chrome.dll',
59                       ],
60                       'outputs': [
61                         '$(OutDir)\\chrome.dll.pdb',
62                       ],
63                       'action': ['tools\\build\\win\\hardlink_failsafe.bat',
64                                  '$(OutDir)\\initial\\chrome.dll.pdb',
65                                  '$(OutDir)\\chrome.dll.pdb'],
66                     }
67                   ]
68                 }]
69               ],
70             }],
71           ]
72         },
73         {
74           # GN version: //chrome:main_dll
75           'target_name': 'chrome_main_dll',
76           'type': 'shared_library',
77           'variables': {
78             'enable_wexit_time_destructors': 1,
79           },
80           'dependencies': [
81             '<@(chromium_browser_dependencies)',
82             '../content/content.gyp:content_app_browser',
83           ],
84           'conditions': [
85             ['OS=="win"', {
86               'dependencies': [
87                 '<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf',
88               ],
89             }],
90             ['OS=="win" and configuration_policy==1', {
91               'dependencies': [
92                 '<(DEPTH)/components/components.gyp:policy',
93               ],
94             }],
95             ['use_aura==1', {
96               'dependencies': [
97                 '../ui/compositor/compositor.gyp:compositor',
98               ],
99             }],
100             ['OS=="win" and target_arch=="ia32"', {
101               # Add a dependency to custom import library for user32 delay
102               # imports only in x86 builds.
103               'dependencies': [
104                 'chrome_user32_delay_imports',
105               ],
106             },],
107             ['OS=="win"', {
108               'product_name': 'chrome',
109               'dependencies': [
110                 # On Windows, link the dependencies (libraries) that make
111                 # up actual Chromium functionality into this .dll.
112                 'chrome_version_resources',
113                 '../chrome/chrome_resources.gyp:chrome_unscaled_resources',
114                 '../content/app/resources/content_resources.gyp:content_resources',
115                 '../crypto/crypto.gyp:crypto',
116                 '../net/net.gyp:net_resources',
117                 '../ui/views/views.gyp:views',
118               ],
119               'sources': [
120                 'app/chrome_command_ids.h',
121                 'app/chrome_dll.rc',
122                 'app/chrome_dll_resource.h',
123                 'app/chrome_main.cc',
124                 'app/chrome_main_delegate.cc',
125                 'app/chrome_main_delegate.h',
126                 'app/delay_load_hook_win.cc',
127                 'app/delay_load_hook_win.h',
129                 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
130                 '../base/win/dllmain.cc',
132                 # Cursors.
133                 '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc',
134               ],
135               'include_dirs': [
136                 '<(DEPTH)/third_party/wtl/include',
137               ],
138               'configurations': {
139                 'Debug_Base': {
140                   'msvs_settings': {
141                     'VCLinkerTool': {
142                       'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
143                     },
144                   },
145                 },
146               },
147               'msvs_settings': {
148                 'VCLinkerTool': {
149                   'ImportLibrary': '$(OutDir)\\lib\\chrome_dll.lib',
150                   # Set /SUBSYSTEM:WINDOWS for chrome.dll (for consistency).
151                   'SubSystem': '2',
152                   'conditions': [
153                     ['incremental_chrome_dll==1', {
154                       'OutputFile': '$(OutDir)\\initial\\chrome.dll',
155                       'UseLibraryDependencyInputs': "true",
156                     }],
157                     ['target_arch=="ia32"', {
158                       # Don't set an x64 base address (to avoid breaking HE-ASLR).
159                       'BaseAddress': '0x01c30000',
160                       # Link against the XP-constrained user32 import library
161                       # instead of the platform-SDK provided one to avoid
162                       # inadvertently taking dependencies on post-XP user32
163                       # exports.
164                       'AdditionalDependencies!': [
165                         'user32.lib',
166                       ],
167                       'IgnoreDefaultLibraryNames': [
168                         'user32.lib',
169                       ],
170                       # Remove user32 delay load for chrome.dll.
171                       'DelayLoadDLLs!': [
172                         'user32.dll',
173                       ],
174                       'AdditionalDependencies': [
175                         'user32.winxp.lib',
176                       ],
177                       'DelayLoadDLLs': [
178                         'user32-delay.dll',
179                       ],
180                       'AdditionalLibraryDirectories': [
181                         '<(DEPTH)/build/win/importlibs/x86',
182                       ],
183                       'ForceSymbolReferences': [
184                         # Force the inclusion of the delay load hook in this
185                         # binary.
186                         '_ChromeDelayLoadHook@8',
187                       ],
188                     }],
189                   ],
190                   'DelayLoadDLLs': [
191                     'comdlg32.dll',
192                     'crypt32.dll',
193                     'cryptui.dll',
194                     'dhcpcsvc.dll',
195                     'imagehlp.dll',
196                     'imm32.dll',
197                     'iphlpapi.dll',
198                     'setupapi.dll',
199                     'urlmon.dll',
200                     'winhttp.dll',
201                     'wininet.dll',
202                     'winspool.drv',
203                     'ws2_32.dll',
204                     'wsock32.dll',
205                   ],
206                 },
207                 'VCManifestTool': {
208                   'AdditionalManifestFiles': [
209                     '$(ProjectDir)\\app\\chrome.dll.manifest',
210                   ],
211                 },
212               },
213               'conditions': [
214                 ['win_use_allocator_shim==1', {
215                   'dependencies': [
216                     '<(allocator_target)',
217                   ],
218                 }],
219                 ['enable_printing!=0', {
220                   'dependencies': [
221                     '../printing/printing.gyp:printing',
222                   ],
223                 }],
224                 ['chrome_pgo_phase==1', {
225                   'msvs_settings': {
226                     'VCLinkerTool': {
227                       'LinkTimeCodeGeneration': '2',
228                     },
229                   },
230                 }],
231                 ['chrome_pgo_phase==2', {
232                   'msvs_settings': {
233                     'VCLinkerTool': {
234                       'LinkTimeCodeGeneration': '3',
235                     },
236                   },
237                 }],
238               ]
239             }],
240             ['chrome_multiple_dll==1', {
241               'defines': [
242                 'CHROME_MULTIPLE_DLL_BROWSER',
243               ],
244             }, {
245               'dependencies': [
246                 '<@(chromium_child_dependencies)',
247                 '../content/content.gyp:content_app_both',
248               ],
249               'dependencies!': [
250                 '../content/content.gyp:content_app_browser',
251               ],
252             }],
253             ['cld_version==0 or cld_version==1', {
254               'dependencies': [
255                 '../third_party/cld/cld.gyp:cld',
256               ],
257             }],
258             ['cld_version==0 or cld_version==2', {
259               'dependencies': [
260                 '../third_party/cld_2/cld_2.gyp:cld_2',
261               ],
262             }],
263             ['OS=="mac" and component!="shared_library"', {
264               'includes': [ 'chrome_dll_bundle.gypi' ],
265             }],
266             ['OS=="mac" and component=="shared_library"', {
267               'xcode_settings': { 'OTHER_LDFLAGS': [ '-Wl,-ObjC' ], },
268             }],
269             ['OS=="mac"', {
270               'xcode_settings': {
271                 # Define the order of symbols within the framework.  This
272                 # sets -order_file.
273                 'ORDER_FILE': 'app/framework.order',
274               },
275               'sources': [
276                 'app/chrome_command_ids.h',
277                 'app/chrome_dll_resource.h',
278                 'app/chrome_main.cc',
279                 'app/chrome_main_delegate.cc',
280                 'app/chrome_main_delegate.h',
281                 'app/chrome_main_mac.mm',
282                 'app/chrome_main_mac.h',
283               ],
284               'dependencies': [
285                 '../pdf/pdf.gyp:pdf',
286               ],
287               'include_dirs': [
288                 '<(grit_out_dir)',
289               ],
290               'postbuilds': [
291                 {
292                   # This step causes an error to be raised if the .order file
293                   # does not account for all global text symbols.  It
294                   # validates the completeness of the .order file.
295                   'postbuild_name': 'Verify global text symbol order',
296                   'variables': {
297                     'verify_order_path': 'tools/build/mac/verify_order',
298                   },
299                   'action': [
300                     '<(verify_order_path)',
301                     '_ChromeMain',
302                     '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}',
303                   ],
304                 },
305               ],
306               'conditions': [
307                 ['mac_breakpad_compiled_in==1', {
308                   'dependencies': [
309                     '../breakpad/breakpad.gyp:breakpad',
310                     '../components/components.gyp:crash_component',
311                     '../components/components.gyp:policy',
312                   ],
313                   'sources': [
314                     'app/chrome_breakpad_client.cc',
315                     'app/chrome_breakpad_client.h',
316                     'app/chrome_breakpad_client_mac.mm',
317                   ],
318                 }, {  # else: mac_breakpad_compiled_in!=1
319                   # No Breakpad, put in the stubs.
320                   'dependencies': [
321                     '../components/components.gyp:breakpad_stubs',
322                   ],
323                 }],  # mac_breakpad_compiled_in
324               ],  # conditions
325             }],  # OS=="mac"
326           ],  # conditions
327         },  # target chrome_main_dll
328       ],  # targets
329     }],  # OS=="mac" or OS=="win"
330     ['chrome_multiple_dll', {
331       'targets': [
332         {
333           'target_name': 'chrome_child_dll',
334           'type': 'shared_library',
335           'product_name': 'chrome_child',
336           'variables': {
337             'enable_wexit_time_destructors': 1,
338           },
339           'dependencies': [
340             '<@(chromium_child_dependencies)',
341             '../content/content.gyp:content_app_child',
342             'chrome_version_resources',
343             'policy_path_parser',
344           ],
345           'defines': [
346             'CHROME_MULTIPLE_DLL_CHILD',
347           ],
348           'sources': [
349             '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
350             'app/chrome_main.cc',
351             'app/chrome_main_delegate.cc',
352             'app/chrome_main_delegate.h',
353           ],
354           'conditions': [
355             ['OS=="win"', {
356               'dependencies': [
357                 '<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf',
358               ],
359               'conditions': [
360                 ['chrome_pgo_phase==1', {
361                   'msvs_settings': {
362                     'VCLinkerTool': {
363                       'LinkTimeCodeGeneration': '2',
364                     },
365                   },
366                 }],
367                 ['chrome_pgo_phase==2', {
368                   'msvs_settings': {
369                     'VCLinkerTool': {
370                       'LinkTimeCodeGeneration': '3',
371                     },
372                   },
373                 }],
374               ]
375             }],
376           ],
377         },  # target chrome_child_dll
378       ],
379     }],
380   ],