Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / chrome_dll.gypi
blob6e3e2010383c7a98b5ec294509a4af6c0bc89acf
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           'target_name': 'chrome_main_dll',
75           'type': 'shared_library',
76           'variables': {
77             'enable_wexit_time_destructors': 1,
78           },
79           'dependencies': [
80             '<@(chromium_browser_dependencies)',
81             '../components/components.gyp:policy',
82             '../content/content.gyp:content_app_browser',
83           ],
84           'conditions': [
85             ['use_aura==1', {
86               'dependencies': [
87                 '../ui/compositor/compositor.gyp:compositor',
88               ],
89             }],
90             ['OS=="win" and target_arch=="ia32" and MSVS_VERSION!="2013"', {
91               # TODO(scottmg): The assembler is very broken in VS2013 and
92               # crashes on the generated .asm file, so disable this for now.
93               # This should be revisited after a VS2013 update. See
94               # http://crbug.com/288948.
95               #
96               # Add a dependency to custom import library for user32 delay
97               # imports only in x86 builds.
98               'dependencies': [
99                 'chrome_user32_delay_imports',
100               ],
101             },],
102             ['OS=="win"', {
103               'product_name': 'chrome',
104               'dependencies': [
105                 # On Windows, link the dependencies (libraries) that make
106                 # up actual Chromium functionality into this .dll.
107                 'chrome_dll_pdb_workaround',
108                 'chrome_version_resources',
109                 '../chrome/chrome_resources.gyp:chrome_unscaled_resources',
110                 '../crypto/crypto.gyp:crypto',
111                 '../net/net.gyp:net_resources',
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',
125                 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
126                 '../base/win/dllmain.cc',
128                 # Cursors.
129                 '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_unscaled_resources.rc',
130               ],
131               'include_dirs': [
132                 '<(DEPTH)/third_party/wtl/include',
133               ],
134               'configurations': {
135                 'Debug_Base': {
136                   'msvs_settings': {
137                     'VCLinkerTool': {
138                       'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
139                     },
140                   },
141                 },
142               },
143               'msvs_settings': {
144                 'VCLinkerTool': {
145                   'BaseAddress': '0x01c30000',
146                   'ImportLibrary': '$(OutDir)\\lib\\chrome_dll.lib',
147                   # Set /SUBSYSTEM:WINDOWS for chrome.dll (for consistency).
148                   'SubSystem': '2',
149                   'conditions': [
150                     ['incremental_chrome_dll==1', {
151                       'OutputFile': '$(OutDir)\\initial\\chrome.dll',
152                       'UseLibraryDependencyInputs': "true",
153                     }],
154                     ['target_arch=="ia32" and MSVS_VERSION!="2013"', {
155                       # Link against the XP-constrained user32 import library
156                       # instead of the platform-SDK provided one to avoid
157                       # inadvertently taking dependencies on post-XP user32
158                       # exports.
159                       'AdditionalDependencies!': [
160                         'user32.lib',
161                       ],
162                       'IgnoreDefaultLibraryNames': [
163                         'user32.lib',
164                       ],
165                       # Remove user32 delay load for chrome.dll.
166                       'DelayLoadDLLs!': [
167                         'user32.dll',
168                       ],
169                       'AdditionalDependencies': [
170                         'user32.winxp.lib',
171                       ],
172                       'DelayLoadDLLs': [
173                         'user32-delay.dll',
174                       ],
175                       'AdditionalLibraryDirectories': [
176                         '<(DEPTH)/build/win/importlibs/x86',
177                       ],
178                       'ForceSymbolReferences': [
179                         # Force the inclusion of the delay load hook in this
180                         # binary.
181                         '_ChromeDelayLoadHook@8',
182                       ],
183                     }],
184                   ],
185                   'DelayLoadDLLs': [
186                     'comdlg32.dll',
187                     'crypt32.dll',
188                     'cryptui.dll',
189                     'dhcpcsvc.dll',
190                     'imagehlp.dll',
191                     'imm32.dll',
192                     'iphlpapi.dll',
193                     'setupapi.dll',
194                     'urlmon.dll',
195                     'winhttp.dll',
196                     'wininet.dll',
197                     'winspool.drv',
198                     'ws2_32.dll',
199                     'wsock32.dll',
200                   ],
201                 },
202                 'VCManifestTool': {
203                   'AdditionalManifestFiles': [
204                     '$(ProjectDir)\\app\\chrome.dll.manifest',
205                   ],
206                 },
207               },
208               'conditions': [
209                 ['win_use_allocator_shim==1', {
210                   'dependencies': [
211                     '<(allocator_target)',
212                   ],
213                 }],
214                 ['enable_printing!=0', {
215                   'dependencies': [
216                     '../printing/printing.gyp:printing',
217                   ],
218                 }],
219               ]
220             }],
221             ['chrome_multiple_dll==1', {
222               'defines': [
223                 'CHROME_MULTIPLE_DLL_BROWSER',
224               ],
225             }, {
226               'dependencies': [
227                 '<@(chromium_child_dependencies)',
228                 '../content/content.gyp:content_app_both',
229                 '../content/content.gyp:content_worker',
230               ],
231               'dependencies!': [
232                 '../content/content.gyp:content_app_browser',
233               ],
234             }],
235             ['cld_version==0 or cld_version==1', {
236               'dependencies': [
237                 '../third_party/cld/cld.gyp:cld',
238               ],
239             }],
240             ['cld_version==0 or cld_version==2', {
241               'dependencies': [
242                 '../third_party/cld_2/cld_2.gyp:cld_2',
243               ],
244             }],
245             ['OS=="mac" and component!="shared_library"', {
246               'includes': [ 'chrome_dll_bundle.gypi' ],
247             }],
248             ['OS=="mac" and component=="shared_library"', {
249               'xcode_settings': { 'OTHER_LDFLAGS': [ '-Wl,-ObjC' ], },
250             }],
251             ['OS=="mac"', {
252               'xcode_settings': {
253                 # Define the order of symbols within the framework.  This
254                 # sets -order_file.
255                 'ORDER_FILE': 'app/framework.order',
256               },
257               'sources': [
258                 'app/chrome_command_ids.h',
259                 'app/chrome_dll_resource.h',
260                 'app/chrome_main.cc',
261                 'app/chrome_main_delegate.cc',
262                 'app/chrome_main_delegate.h',
263                 'app/chrome_main_mac.mm',
264                 'app/chrome_main_mac.h',
265               ],
266               'include_dirs': [
267                 '<(grit_out_dir)',
268               ],
269               'postbuilds': [
270                 {
271                   # This step causes an error to be raised if the .order file
272                   # does not account for all global text symbols.  It
273                   # validates the completeness of the .order file.
274                   'postbuild_name': 'Verify global text symbol order',
275                   'variables': {
276                     'verify_order_path': 'tools/build/mac/verify_order',
277                   },
278                   'action': [
279                     '<(verify_order_path)',
280                     '_ChromeMain',
281                     '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}',
282                   ],
283                 },
284               ],
285               'conditions': [
286                 ['mac_breakpad_compiled_in==1', {
287                   'dependencies': [
288                     '../breakpad/breakpad.gyp:breakpad',
289                     '../components/components.gyp:breakpad_component',
290                     '../components/components.gyp:policy',
291                   ],
292                   'sources': [
293                     'app/chrome_breakpad_client.cc',
294                     'app/chrome_breakpad_client.h',
295                     'app/chrome_breakpad_client_mac.mm',
296                   ],
297                 }, {  # else: mac_breakpad_compiled_in!=1
298                   # No Breakpad, put in the stubs.
299                   'dependencies': [
300                     '../components/components.gyp:breakpad_stubs',
301                   ],
302                 }],  # mac_breakpad_compiled_in
303                 ['internal_pdf', {
304                   'dependencies': [
305                     '../pdf/pdf.gyp:pdf',
306                   ],
307                 }],
308               ],  # conditions
309             }],  # OS=="mac"
310           ],  # conditions
311         },  # target chrome_main_dll
312       ],  # targets
313     }],  # OS=="mac" or OS=="win"
314     ['OS=="win"', {
315       'targets': [
316         {
317           # This target is only depended upon on Windows.
318           'target_name': 'chrome_dll_pdb_workaround',
319           'type': 'static_library',
320           'sources': [ 'empty_pdb_workaround.cc' ],
321           'conditions': [
322             ['fastbuild==0 or win_z7!=0', {
323              'msvs_settings': {
324               'VCCLCompilerTool': {
325                 # This *in the compile phase* must match the pdb name that's
326                 # output by the final link. See empty_pdb_workaround.cc for
327                 # more details.
328                 'DebugInformationFormat': '3',
329                 'ProgramDataBaseFileName': '<(PRODUCT_DIR)/chrome.dll.pdb',
330               },
331              },
332             }],
333           ],
334         },
335       ],
336     }],
337     ['chrome_multiple_dll', {
338       'targets': [
339         {
340           'target_name': 'chrome_child_dll',
341           'type': 'shared_library',
342           'product_name': 'chrome_child',
343           'variables': {
344             'enable_wexit_time_destructors': 1,
345           },
346           'dependencies': [
347             '<@(chromium_child_dependencies)',
348             '../content/content.gyp:content_app_child',
349             '../content/content.gyp:content_worker',
350             'chrome_version_resources',
351             'policy_path_parser',
352           ],
353           'defines': [
354             'CHROME_MULTIPLE_DLL_CHILD',
355           ],
356           'sources': [
357             '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
358             'app/chrome_main.cc',
359             'app/chrome_main_delegate.cc',
360             'app/chrome_main_delegate.h',
361           ],
362         },  # target chrome_child_dll
363       ],
364     }],
365   ],