Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / chrome / chrome_dll.gypi
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                 },
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"', {
91               # Add a dependency to custom import library for user32 delay
92               # imports only in x86 builds.
93               'dependencies': [
94                 'chrome_user32_delay_imports',
95               ],
96             },],
97             ['OS=="win"', {
98               'product_name': 'chrome',
99               'dependencies': [
100                 # On Windows, link the dependencies (libraries) that make
101                 # up actual Chromium functionality into this .dll.
102                 'chrome_dll_pdb_workaround',
103                 'chrome_version_resources',
104                 '../chrome/chrome_resources.gyp:chrome_unscaled_resources',
105                 '../crypto/crypto.gyp:crypto',
106                 '../net/net.gyp:net_resources',
107                 '../ui/views/views.gyp:views',
108                 '../webkit/webkit_resources.gyp:webkit_resources',
109               ],
110               'sources': [
111                 'app/chrome_command_ids.h',
112                 'app/chrome_dll.rc',
113                 'app/chrome_dll_resource.h',
114                 'app/chrome_main.cc',
115                 'app/chrome_main_delegate.cc',
116                 'app/chrome_main_delegate.h',
117                 'app/delay_load_hook_win.cc',
118                 'app/delay_load_hook_win.h',
119
120                 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
121                 '../base/win/dllmain.cc',
122
123                 # Cursors.
124                 '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_unscaled_resources.rc',
125               ],
126               'include_dirs': [
127                 '<(DEPTH)/third_party/wtl/include',
128               ],
129               'configurations': {
130                 'Debug_Base': {
131                   'msvs_settings': {
132                     'VCLinkerTool': {
133                       'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
134                     },
135                   },
136                 },
137               },
138               'msvs_settings': {
139                 'VCLinkerTool': {
140                   'BaseAddress': '0x01c30000',
141                   'ImportLibrary': '$(OutDir)\\lib\\chrome_dll.lib',
142                   # Set /SUBSYSTEM:WINDOWS for chrome.dll (for consistency).
143                   'SubSystem': '2',
144                   'conditions': [
145                     ['incremental_chrome_dll==1', {
146                       'OutputFile': '$(OutDir)\\initial\\chrome.dll',
147                       'UseLibraryDependencyInputs': "true",
148                     }],
149                     ['target_arch=="ia32"', {
150                       # Link against the XP-constrained user32 import library
151                       # instead of the platform-SDK provided one to avoid
152                       # inadvertently taking dependencies on post-XP user32
153                       # exports.
154                       'AdditionalDependencies!': [
155                         'user32.lib',
156                       ],
157                       'IgnoreDefaultLibraryNames': [
158                         'user32.lib',
159                       ],
160                       # Remove user32 delay load for chrome.dll.
161                       'DelayLoadDLLs!': [
162                         'user32.dll',
163                       ],
164                       'AdditionalDependencies': [
165                         'user32.winxp.lib',
166                       ],
167                       'DelayLoadDLLs': [
168                         'user32-delay.dll',
169                       ],
170                       'AdditionalLibraryDirectories': [
171                         '<(DEPTH)/build/win/importlibs/x86',
172                       ],
173                       'ForceSymbolReferences': [
174                         # Force the inclusion of the delay load hook in this
175                         # binary.
176                         '_ChromeDelayLoadHook@8',
177                       ],
178                     }],
179                   ],
180                   'DelayLoadDLLs': [
181                     'comdlg32.dll',
182                     'crypt32.dll',
183                     'cryptui.dll',
184                     'dhcpcsvc.dll',
185                     'imagehlp.dll',
186                     'imm32.dll',
187                     'iphlpapi.dll',
188                     'setupapi.dll',
189                     'urlmon.dll',
190                     'winhttp.dll',
191                     'wininet.dll',
192                     'winspool.drv',
193                     'ws2_32.dll',
194                     'wsock32.dll',
195                   ],
196                 },
197                 'VCManifestTool': {
198                   'AdditionalManifestFiles': [
199                     '$(ProjectDir)\\app\\chrome.dll.manifest',
200                   ],
201                 },
202               },
203               'conditions': [
204                 ['win_use_allocator_shim==1', {
205                   'dependencies': [
206                     '<(allocator_target)',
207                   ],
208                 }],
209                 ['enable_printing!=0', {
210                   'dependencies': [
211                     '../printing/printing.gyp:printing',
212                   ],
213                 }],
214               ]
215             }],
216             ['chrome_multiple_dll==1', {
217               'defines': [
218                 'CHROME_MULTIPLE_DLL_BROWSER',
219               ],
220             }, {
221               'dependencies': [
222                 '<@(chromium_child_dependencies)',
223                 '../content/content.gyp:content_app_both',
224                 '../content/content.gyp:content_worker',
225               ],
226               'dependencies!': [
227                 '../content/content.gyp:content_app_browser',
228               ],
229             }],
230             ['cld_version==0 or cld_version==1', {
231               'dependencies': [
232                 '../third_party/cld/cld.gyp:cld',
233               ],
234             }],
235             ['cld_version==0 or cld_version==2', {
236               'dependencies': [
237                 '../third_party/cld_2/cld_2.gyp:cld_2',
238               ],
239             }],
240             ['OS=="mac" and component!="shared_library"', {
241               'includes': [ 'chrome_dll_bundle.gypi' ],
242             }],
243             ['OS=="mac" and component=="shared_library"', {
244               'xcode_settings': { 'OTHER_LDFLAGS': [ '-Wl,-ObjC' ], },
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_mac.mm',
259                 'app/chrome_main_mac.h',
260               ],
261               'include_dirs': [
262                 '<(grit_out_dir)',
263               ],
264               'postbuilds': [
265                 {
266                   # This step causes an error to be raised if the .order file
267                   # does not account for all global text symbols.  It
268                   # validates the completeness of the .order file.
269                   'postbuild_name': 'Verify global text symbol order',
270                   'variables': {
271                     'verify_order_path': 'tools/build/mac/verify_order',
272                   },
273                   'action': [
274                     '<(verify_order_path)',
275                     '_ChromeMain',
276                     '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}',
277                   ],
278                 },
279               ],
280               'conditions': [
281                 ['mac_breakpad_compiled_in==1', {
282                   'dependencies': [
283                     '../breakpad/breakpad.gyp:breakpad',
284                     '../components/components.gyp:breakpad_component',
285                     '../components/components.gyp:policy',
286                   ],
287                   'sources': [
288                     'app/chrome_breakpad_client.cc',
289                     'app/chrome_breakpad_client.h',
290                     'app/chrome_breakpad_client_mac.mm',
291                   ],
292                 }, {  # else: mac_breakpad_compiled_in!=1
293                   # No Breakpad, put in the stubs.
294                   'dependencies': [
295                     '../components/components.gyp:breakpad_stubs',
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     ['chrome_multiple_dll', {
333       'targets': [
334         {
335           'target_name': 'chrome_child_dll',
336           'type': 'shared_library',
337           'product_name': 'chrome_child',
338           'variables': {
339             'enable_wexit_time_destructors': 1,
340           },
341           'dependencies': [
342             '<@(chromium_child_dependencies)',
343             '../content/content.gyp:content_app_child',
344             '../content/content.gyp:content_worker',
345             'chrome_version_resources',
346             'policy_path_parser',
347           ],
348           'defines': [
349             'CHROME_MULTIPLE_DLL_CHILD',
350           ],
351           'sources': [
352             '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
353             'app/chrome_main.cc',
354             'app/chrome_main_delegate.cc',
355             'app/chrome_main_delegate.h',
356           ],
357         },  # target chrome_child_dll
358       ],
359     }],
360   ],
361 }