Upstream version 9.38.198.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             '../content/content.gyp:content_app_browser',
82           ],
83           'conditions': [
84             ['OS=="win"', {
85               'dependencies': [
86                 '<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf',
87               ],
88             }],
89             ['OS=="win" and configuration_policy==1', {
90               'dependencies': [
91                 '<(DEPTH)/components/components.gyp:policy',
92               ],
93             }],
94             ['use_aura==1', {
95               'dependencies': [
96                 '../ui/compositor/compositor.gyp:compositor',
97               ],
98             }],
99             ['OS=="win" and target_arch=="ia32"', {
100               # Add a dependency to custom import library for user32 delay
101               # imports only in x86 builds.
102               'dependencies': [
103                 'chrome_user32_delay_imports',
104               ],
105             },],
106             ['OS=="win"', {
107               'product_name': 'chrome',
108               'dependencies': [
109                 # On Windows, link the dependencies (libraries) that make
110                 # up actual Chromium functionality into this .dll.
111                 'chrome_version_resources',
112                 '../chrome/chrome_resources.gyp:chrome_unscaled_resources',
113                 '../crypto/crypto.gyp:crypto',
114                 '../net/net.gyp:net_resources',
115                 '../ui/views/views.gyp:views',
116                 '../webkit/glue/resources/webkit_resources.gyp:webkit_resources',
117               ],
118               'sources': [
119                 'app/chrome_command_ids.h',
120                 'app/chrome_dll.rc',
121                 'app/chrome_dll_resource.h',
122                 'app/chrome_main.cc',
123                 'app/chrome_main_delegate.cc',
124                 'app/chrome_main_delegate.h',
125                 'app/delay_load_hook_win.cc',
126                 'app/delay_load_hook_win.h',
127
128                 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
129                 '../base/win/dllmain.cc',
130
131                 # Cursors.
132                 '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc',
133               ],
134               'include_dirs': [
135                 '<(DEPTH)/third_party/wtl/include',
136               ],
137               'configurations': {
138                 'Debug_Base': {
139                   'msvs_settings': {
140                     'VCLinkerTool': {
141                       'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
142                     },
143                   },
144                 },
145               },
146               'msvs_settings': {
147                 'VCLinkerTool': {
148                   'ImportLibrary': '$(OutDir)\\lib\\chrome_dll.lib',
149                   # Set /SUBSYSTEM:WINDOWS for chrome.dll (for consistency).
150                   'SubSystem': '2',
151                   'conditions': [
152                     ['incremental_chrome_dll==1', {
153                       'OutputFile': '$(OutDir)\\initial\\chrome.dll',
154                       'UseLibraryDependencyInputs': "true",
155                     }],
156                     ['target_arch=="ia32"', {
157                       # Don't set an x64 base address (to avoid breaking HE-ASLR).
158                       'BaseAddress': '0x01c30000',
159                       # Link against the XP-constrained user32 import library
160                       # instead of the platform-SDK provided one to avoid
161                       # inadvertently taking dependencies on post-XP user32
162                       # exports.
163                       'AdditionalDependencies!': [
164                         'user32.lib',
165                       ],
166                       'IgnoreDefaultLibraryNames': [
167                         'user32.lib',
168                       ],
169                       # Remove user32 delay load for chrome.dll.
170                       'DelayLoadDLLs!': [
171                         'user32.dll',
172                       ],
173                       'AdditionalDependencies': [
174                         'user32.winxp.lib',
175                       ],
176                       'DelayLoadDLLs': [
177                         'user32-delay.dll',
178                       ],
179                       'AdditionalLibraryDirectories': [
180                         '<(DEPTH)/build/win/importlibs/x86',
181                       ],
182                       'ForceSymbolReferences': [
183                         # Force the inclusion of the delay load hook in this
184                         # binary.
185                         '_ChromeDelayLoadHook@8',
186                       ],
187                     }],
188                   ],
189                   'DelayLoadDLLs': [
190                     'comdlg32.dll',
191                     'crypt32.dll',
192                     'cryptui.dll',
193                     'dhcpcsvc.dll',
194                     'imagehlp.dll',
195                     'imm32.dll',
196                     'iphlpapi.dll',
197                     'setupapi.dll',
198                     'urlmon.dll',
199                     'winhttp.dll',
200                     'wininet.dll',
201                     'winspool.drv',
202                     'ws2_32.dll',
203                     'wsock32.dll',
204                   ],
205                 },
206                 'VCManifestTool': {
207                   'AdditionalManifestFiles': [
208                     '$(ProjectDir)\\app\\chrome.dll.manifest',
209                   ],
210                 },
211               },
212               'conditions': [
213                 ['win_use_allocator_shim==1', {
214                   'dependencies': [
215                     '<(allocator_target)',
216                   ],
217                 }],
218                 ['enable_printing!=0', {
219                   'dependencies': [
220                     '../printing/printing.gyp:printing',
221                   ],
222                 }],
223                 ['chrome_pgo_phase==1', {
224                   'msvs_settings': {
225                     'VCLinkerTool': {
226                       'LinkTimeCodeGeneration': '2',
227                     },
228                   },
229                 }],
230                 ['chrome_pgo_phase==2', {
231                   'msvs_settings': {
232                     'VCLinkerTool': {
233                       'LinkTimeCodeGeneration': '3',
234                     },
235                   },
236                 }],
237               ]
238             }],
239             ['chrome_multiple_dll==1', {
240               'defines': [
241                 'CHROME_MULTIPLE_DLL_BROWSER',
242               ],
243             }, {
244               'dependencies': [
245                 '<@(chromium_child_dependencies)',
246                 '../content/content.gyp:content_app_both',
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               'dependencies': [
284                 '../pdf/pdf.gyp:pdf',
285               ],
286               'include_dirs': [
287                 '<(grit_out_dir)',
288               ],
289               'postbuilds': [
290                 {
291                   # This step causes an error to be raised if the .order file
292                   # does not account for all global text symbols.  It
293                   # validates the completeness of the .order file.
294                   'postbuild_name': 'Verify global text symbol order',
295                   'variables': {
296                     'verify_order_path': 'tools/build/mac/verify_order',
297                   },
298                   'action': [
299                     '<(verify_order_path)',
300                     '_ChromeMain',
301                     '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}',
302                   ],
303                 },
304               ],
305               'conditions': [
306                 ['mac_breakpad_compiled_in==1', {
307                   'dependencies': [
308                     '../breakpad/breakpad.gyp:breakpad',
309                     '../components/components.gyp:breakpad_component',
310                     '../components/components.gyp:policy',
311                   ],
312                   'sources': [
313                     'app/chrome_breakpad_client.cc',
314                     'app/chrome_breakpad_client.h',
315                     'app/chrome_breakpad_client_mac.mm',
316                   ],
317                 }, {  # else: mac_breakpad_compiled_in!=1
318                   # No Breakpad, put in the stubs.
319                   'dependencies': [
320                     '../components/components.gyp:breakpad_stubs',
321                   ],
322                 }],  # mac_breakpad_compiled_in
323               ],  # conditions
324             }],  # OS=="mac"
325           ],  # conditions
326         },  # target chrome_main_dll
327       ],  # targets
328     }],  # OS=="mac" or OS=="win"
329     ['chrome_multiple_dll', {
330       'targets': [
331         {
332           'target_name': 'chrome_child_dll',
333           'type': 'shared_library',
334           'product_name': 'chrome_child',
335           'variables': {
336             'enable_wexit_time_destructors': 1,
337           },
338           'dependencies': [
339             '<@(chromium_child_dependencies)',
340             '../content/content.gyp:content_app_child',
341             'chrome_version_resources',
342             'policy_path_parser',
343           ],
344           'defines': [
345             'CHROME_MULTIPLE_DLL_CHILD',
346           ],
347           'sources': [
348             '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
349             'app/chrome_main.cc',
350             'app/chrome_main_delegate.cc',
351             'app/chrome_main_delegate.h',
352           ],
353           'conditions': [
354             ['OS=="win"', {
355               'dependencies': [
356                 '<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf',
357               ],
358               'conditions': [
359                 ['chrome_pgo_phase==1', {
360                   'msvs_settings': {
361                     'VCLinkerTool': {
362                       'LinkTimeCodeGeneration': '2',
363                     },
364                   },
365                 }],
366                 ['chrome_pgo_phase==2', {
367                   'msvs_settings': {
368                     'VCLinkerTool': {
369                       'LinkTimeCodeGeneration': '3',
370                     },
371                   },
372                 }],
373               ]
374             }],
375           ],
376         },  # target chrome_child_dll
377       ],
378     }],
379   ],
380 }