Suppress tabs permission warning if there is already a browsingHistory warning.
[chromium-blink-merge.git] / chrome / chrome_dll.gypi
blob47e9304815cd47e099cf0360212833d64980bcc5
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             ['OS=="win"', {
86               'dependencies': [
87                 '<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf',
88               ],
89             }],
90             ['use_aura==1', {
91               'dependencies': [
92                 '../ui/compositor/compositor.gyp:compositor',
93               ],
94             }],
95             ['OS=="win" and target_arch=="ia32"', {
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                 # TODO(dcheng): remove this temporary hack once WebLocalFrame lands and rolls.
113                 '../third_party/WebKit/public/blink_headers.gyp:blink_headers',
114                 '../ui/views/views.gyp:views',
115                 '../webkit/webkit_resources.gyp:webkit_resources',
116               ],
117               'sources': [
118                 'app/chrome_command_ids.h',
119                 'app/chrome_dll.rc',
120                 'app/chrome_dll_resource.h',
121                 'app/chrome_main.cc',
122                 'app/chrome_main_delegate.cc',
123                 'app/chrome_main_delegate.h',
124                 'app/delay_load_hook_win.cc',
125                 'app/delay_load_hook_win.h',
127                 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
128                 '../base/win/dllmain.cc',
130                 # Cursors.
131                 '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_unscaled_resources.rc',
132               ],
133               'include_dirs': [
134                 '<(DEPTH)/third_party/wtl/include',
135               ],
136               'configurations': {
137                 'Debug_Base': {
138                   'msvs_settings': {
139                     'VCLinkerTool': {
140                       'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
141                     },
142                   },
143                 },
144               },
145               'msvs_settings': {
146                 'VCLinkerTool': {
147                   'ImportLibrary': '$(OutDir)\\lib\\chrome_dll.lib',
148                   # Set /SUBSYSTEM:WINDOWS for chrome.dll (for consistency).
149                   'SubSystem': '2',
150                   'conditions': [
151                     ['incremental_chrome_dll==1', {
152                       'OutputFile': '$(OutDir)\\initial\\chrome.dll',
153                       'UseLibraryDependencyInputs': "true",
154                     }],
155                     ['target_arch=="ia32"', {
156                       # Don't set an x64 base address (to avoid breaking HE-ASLR).
157                       'BaseAddress': '0x01c30000',
158                       # Link against the XP-constrained user32 import library
159                       # instead of the platform-SDK provided one to avoid
160                       # inadvertently taking dependencies on post-XP user32
161                       # exports.
162                       'AdditionalDependencies!': [
163                         'user32.lib',
164                       ],
165                       'IgnoreDefaultLibraryNames': [
166                         'user32.lib',
167                       ],
168                       # Remove user32 delay load for chrome.dll.
169                       'DelayLoadDLLs!': [
170                         'user32.dll',
171                       ],
172                       'AdditionalDependencies': [
173                         'user32.winxp.lib',
174                       ],
175                       'DelayLoadDLLs': [
176                         'user32-delay.dll',
177                       ],
178                       'AdditionalLibraryDirectories': [
179                         '<(DEPTH)/build/win/importlibs/x86',
180                       ],
181                       'ForceSymbolReferences': [
182                         # Force the inclusion of the delay load hook in this
183                         # binary.
184                         '_ChromeDelayLoadHook@8',
185                       ],
186                     }],
187                   ],
188                   'DelayLoadDLLs': [
189                     'comdlg32.dll',
190                     'crypt32.dll',
191                     'cryptui.dll',
192                     'dhcpcsvc.dll',
193                     'imagehlp.dll',
194                     'imm32.dll',
195                     'iphlpapi.dll',
196                     'setupapi.dll',
197                     'urlmon.dll',
198                     'winhttp.dll',
199                     'wininet.dll',
200                     'winspool.drv',
201                     'ws2_32.dll',
202                     'wsock32.dll',
203                   ],
204                 },
205                 'VCManifestTool': {
206                   'AdditionalManifestFiles': [
207                     '$(ProjectDir)\\app\\chrome.dll.manifest',
208                   ],
209                 },
210               },
211               'conditions': [
212                 ['win_use_allocator_shim==1', {
213                   'dependencies': [
214                     '<(allocator_target)',
215                   ],
216                 }],
217                 ['enable_printing!=0', {
218                   'dependencies': [
219                     '../printing/printing.gyp:printing',
220                   ],
221                 }],
222                 ['chrome_pgo_phase==1', {
223                   'msvs_settings': {
224                     'VCLinkerTool': {
225                       'LinkTimeCodeGeneration': '2',
226                     },
227                   },
228                 }],
229                 ['chrome_pgo_phase==2', {
230                   'msvs_settings': {
231                     'VCLinkerTool': {
232                       'LinkTimeCodeGeneration': '3',
233                     },
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             ['cld_version==0 or cld_version==1', {
253               'dependencies': [
254                 '../third_party/cld/cld.gyp:cld',
255               ],
256             }],
257             ['cld_version==0 or cld_version==2', {
258               'dependencies': [
259                 '../third_party/cld_2/cld_2.gyp:cld_2',
260               ],
261             }],
262             ['OS=="mac" and component!="shared_library"', {
263               'includes': [ 'chrome_dll_bundle.gypi' ],
264             }],
265             ['OS=="mac" and component=="shared_library"', {
266               'xcode_settings': { 'OTHER_LDFLAGS': [ '-Wl,-ObjC' ], },
267             }],
268             ['OS=="mac"', {
269               'xcode_settings': {
270                 # Define the order of symbols within the framework.  This
271                 # sets -order_file.
272                 'ORDER_FILE': 'app/framework.order',
273               },
274               'sources': [
275                 'app/chrome_command_ids.h',
276                 'app/chrome_dll_resource.h',
277                 'app/chrome_main.cc',
278                 'app/chrome_main_delegate.cc',
279                 'app/chrome_main_delegate.h',
280                 'app/chrome_main_mac.mm',
281                 'app/chrome_main_mac.h',
282               ],
283               'include_dirs': [
284                 '<(grit_out_dir)',
285               ],
286               'postbuilds': [
287                 {
288                   # This step causes an error to be raised if the .order file
289                   # does not account for all global text symbols.  It
290                   # validates the completeness of the .order file.
291                   'postbuild_name': 'Verify global text symbol order',
292                   'variables': {
293                     'verify_order_path': 'tools/build/mac/verify_order',
294                   },
295                   'action': [
296                     '<(verify_order_path)',
297                     '_ChromeMain',
298                     '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}',
299                   ],
300                 },
301               ],
302               'conditions': [
303                 ['mac_breakpad_compiled_in==1', {
304                   'dependencies': [
305                     '../breakpad/breakpad.gyp:breakpad',
306                     '../components/components.gyp:breakpad_component',
307                     '../components/components.gyp:policy',
308                   ],
309                   'sources': [
310                     'app/chrome_breakpad_client.cc',
311                     'app/chrome_breakpad_client.h',
312                     'app/chrome_breakpad_client_mac.mm',
313                   ],
314                 }, {  # else: mac_breakpad_compiled_in!=1
315                   # No Breakpad, put in the stubs.
316                   'dependencies': [
317                     '../components/components.gyp:breakpad_stubs',
318                   ],
319                 }],  # mac_breakpad_compiled_in
320                 ['internal_pdf', {
321                   'dependencies': [
322                     '../pdf/pdf.gyp:pdf',
323                   ],
324                 }],
325               ],  # conditions
326             }],  # OS=="mac"
327           ],  # conditions
328         },  # target chrome_main_dll
329       ],  # targets
330     }],  # OS=="mac" or OS=="win"
331     ['OS=="win"', {
332       'targets': [
333         {
334           # This target is only depended upon on Windows.
335           'target_name': 'chrome_dll_pdb_workaround',
336           'type': 'static_library',
337           'sources': [ 'empty_pdb_workaround.cc' ],
338           'conditions': [
339             ['fastbuild==0 or win_z7!=0', {
340              'msvs_settings': {
341               'VCCLCompilerTool': {
342                 # This *in the compile phase* must match the pdb name that's
343                 # output by the final link. See empty_pdb_workaround.cc for
344                 # more details.
345                 'DebugInformationFormat': '3',
346                 'ProgramDataBaseFileName': '<(PRODUCT_DIR)/chrome.dll.pdb',
347               },
348              },
349             }],
350           ],
351         },
352       ],
353     }],
354     ['chrome_multiple_dll', {
355       'targets': [
356         {
357           'target_name': 'chrome_child_dll',
358           'type': 'shared_library',
359           'product_name': 'chrome_child',
360           'variables': {
361             'enable_wexit_time_destructors': 1,
362           },
363           'dependencies': [
364             '<@(chromium_child_dependencies)',
365             '../content/content.gyp:content_app_child',
366             '../content/content.gyp:content_worker',
367             # TODO(dcheng): remove this temporary hack once WebLocalFrame lands and rolls.
368             '../third_party/WebKit/public/blink_headers.gyp:blink_headers',
369             'chrome_version_resources',
370             'policy_path_parser',
371           ],
372           'defines': [
373             'CHROME_MULTIPLE_DLL_CHILD',
374           ],
375           'sources': [
376             '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
377             'app/chrome_main.cc',
378             'app/chrome_main_delegate.cc',
379             'app/chrome_main_delegate.h',
380           ],
381           'conditions': [
382             ['OS=="win"', {
383               'dependencies': [
384                 '<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf',
385               ],
386               'conditions': [
387                 ['chrome_pgo_phase==1', {
388                   'msvs_settings': {
389                     'VCLinkerTool': {
390                       'LinkTimeCodeGeneration': '2',
391                     },
392                   },
393                 }],
394                 ['chrome_pgo_phase==2', {
395                   'msvs_settings': {
396                     'VCLinkerTool': {
397                       'LinkTimeCodeGeneration': '3',
398                     },
399                   },
400                 }],
401               ]
402             }],
403           ],
404         },  # target chrome_child_dll
405       ],
406     }],
407   ],