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