Fixed compile warnings.
[chromium-blink-merge.git] / chrome / chrome_dll.gypi
blob2744184ac80d6a50a2e76e823370a3439b4e52fe
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             ['incremental_chrome_dll==1', {
16               # Linking to a different directory and then hardlinking back
17               # to OutDir is a workaround to avoid having the .ilk for
18               # chrome.exe and chrome.dll conflicting. See crbug.com/92528
19               # for more information. Done on the dll instead of the exe so
20               # that people launching from VS don't need to modify
21               # $(TargetPath) for the exe.
22               'actions': [
23                 {
24                   'action_name': 'hardlink_to_output',
25                   'inputs': [
26                     '$(OutDir)\\initial\\chrome.dll',
27                   ],
28                   'outputs': [
29                     '$(OutDir)\\chrome.dll',
30                   ],
31                   'action': ['tools\\build\\win\\hardlink_failsafe.bat',
32                              '$(OutDir)\\initial\\chrome.dll',
33                              '$(OutDir)\\chrome.dll'],
34                   'msvs_cygwin_shell': 0,
35                 }
36               ],
37             }],
38           ]
39         },
40         {
41           'target_name': 'chrome_main_dll',
42           'type': 'shared_library',
43           'variables': {
44             'enable_wexit_time_destructors': 1,
45           },
46           'dependencies': [
47             '<@(chromium_dependencies)',
48             'app/policy/cloud_policy_codegen.gyp:policy',
49           ],
50           'conditions': [
51             ['use_aura==1', {
52               'dependencies': [
53                 '../ui/gfx/compositor/compositor.gyp:compositor',
54               ],
55             }],
56             ['OS=="win"', {
57               'product_name': 'chrome',
58               'dependencies': [
59                 # On Windows, link the dependencies (libraries) that make
60                 # up actual Chromium functionality into this .dll.
61                 'chrome_resources.gyp:chrome_resources',
62                 'chrome_version_resources',
63                 'installer_util_strings',
64                 '../content/content.gyp:content_worker',
65                 '../crypto/crypto.gyp:crypto',
66                 '../printing/printing.gyp:printing',
67                 '../net/net.gyp:net_resources',
68                 '../third_party/cld/cld.gyp:cld',
69                 '../ui/views/views.gyp:views',
70                 '../webkit/support/webkit_support.gyp:webkit_resources',
71               ],
72               'sources': [
73                 'app/chrome_command_ids.h',
74                 'app/chrome_dll.rc',
75                 'app/chrome_dll_resource.h',
76                 'app/chrome_main.cc',
77                 'app/chrome_main_delegate.cc',
78                 'app/chrome_main_delegate.h',
80                 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
81                 '../base/win/dllmain.cc',
83                 '../webkit/glue/resources/aliasb.cur',
84                 '../webkit/glue/resources/cell.cur',
85                 '../webkit/glue/resources/col_resize.cur',
86                 '../webkit/glue/resources/copy.cur',
87                 '../webkit/glue/resources/none.cur',
88                 '../webkit/glue/resources/row_resize.cur',
89                 '../webkit/glue/resources/vertical_text.cur',
90                 '../webkit/glue/resources/zoom_in.cur',
91                 '../webkit/glue/resources/zoom_out.cur',
93                 # TODO:  It would be nice to have these pulled in
94                 # automatically from direct_dependent_settings in
95                 # their various targets (net.gyp:net_resources, etc.),
96                 # but that causes errors in other targets when
97                 # resulting .res files get referenced multiple times.
98                 '<(SHARED_INTERMEDIATE_DIR)/chrome/browser_resources.rc',
99                 '<(SHARED_INTERMEDIATE_DIR)/chrome/common_resources.rc',
100                 '<(SHARED_INTERMEDIATE_DIR)/chrome/extensions_api_resources.rc',
101                 '<(SHARED_INTERMEDIATE_DIR)/chrome/renderer_resources.rc',
102                 '<(SHARED_INTERMEDIATE_DIR)/chrome/theme_resources.rc',
103                 '<(SHARED_INTERMEDIATE_DIR)/chrome/theme_resources_standard.rc',
104                 '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.rc',
105                 '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
106                 '<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gfx_resources.rc',
107                 '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources.rc',
108                 '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources_standard/ui_resources_standard.rc',
109                 '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc',
110                 '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.rc',
112                 # TODO(sgk):  left-over from pre-gyp build, figure out
113                 # if we still need them and/or how to update to gyp.
114                 #'app/check_dependents.bat',
115                 #'app/chrome.dll.deps',
116               ],
117               'include_dirs': [
118                 '<(DEPTH)/third_party/wtl/include',
119               ],
120               'defines': [
121                 'CHROME_DLL',
122                 'BROWSER_DLL',
123                 'RENDERER_DLL',
124                 'PLUGIN_DLL',
125               ],
126               'configurations': {
127                 'Debug_Base': {
128                   'msvs_settings': {
129                     'VCLinkerTool': {
130                       'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
131                     },
132                   },
133                 },
134               },
135               'msvs_settings': {
136                 'VCLinkerTool': {
137                   'AdditionalLibraryDirectories': ['$(DXSDK_DIR)/lib/x86'],
138                   'BaseAddress': '0x01c30000',
139                   'ImportLibrary': '$(OutDir)\\lib\\chrome_dll.lib',
140                   'ProgramDatabaseFile': '$(OutDir)\\chrome_dll.pdb',
141                   # Set /SUBSYSTEM:WINDOWS for chrome.dll (for consistency).
142                   'SubSystem': '2',
143                   'conditions': [
144                     ['incremental_chrome_dll==1', {
145                       'OutputFile': '$(OutDir)\\initial\\chrome.dll',
146                       'UseLibraryDependencyInputs': "true",
147                     }],
148                   ],
149                   'DelayLoadDLLs': [
150                     'comdlg32.dll',
151                     'crypt32.dll',
152                     'cryptui.dll',
153                     'dhcpcsvc.dll',
154                     'imagehlp.dll',
155                     'imm32.dll',
156                     'iphlpapi.dll',
157                     'setupapi.dll',
158                     'urlmon.dll',
159                     'winhttp.dll',
160                     'wininet.dll',
161                     'winspool.drv',
162                     'ws2_32.dll',
163                     'wsock32.dll',
164                   ],
165                 },
166                 'VCManifestTool': {
167                   'AdditionalManifestFiles': '$(ProjectDir)\\app\\chrome.dll.manifest',
168                 },
169               },
170             }],  # OS=="win"
171             ['OS=="mac"', {
172               # The main browser executable's name is <(mac_product_name).
173               # Certain things will get confused if two modules in the
174               # executable share the same name, so append " Framework" to the
175               # product_name used for the framework.  This will result in
176               # a name like "Chromium Framework.framework".
177               'product_name': '<(mac_product_name) Framework',
178               'mac_bundle': 1,
179               'xcode_settings': {
180                 'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)',
182                 # The dylib versions are of the form a[.b[.c]], where a is a
183                 # 16-bit unsigned integer, and b and c are 8-bit unsigned
184                 # integers.  Any missing component is taken to be 0.  The
185                 # best mapping from product version numbers into this scheme
186                 # is to just use a=BUILD, b=(PATCH/256), c=(PATCH%256). There
187                 # is no ambiguity in this scheme because the build and patch
188                 # numbers are guaranteed unique even across distinct major
189                 # and minor version numbers.  These settings correspond to
190                 # -compatibility_version and -current_version.
191                 'DYLIB_COMPATIBILITY_VERSION': '<(version_mac_dylib)',
192                 'DYLIB_CURRENT_VERSION': '<(version_mac_dylib)',
194                 # The framework is placed within the .app's versioned
195                 # directory.  DYLIB_INSTALL_NAME_BASE and
196                 # LD_DYLIB_INSTALL_NAME affect -install_name.
197                 'DYLIB_INSTALL_NAME_BASE':
198                     '@executable_path/../Versions/<(version_full)',
199                 # See /build/mac/copy_framework_unversioned.sh for
200                 # information on LD_DYLIB_INSTALL_NAME.
201                 'LD_DYLIB_INSTALL_NAME':
202                     '$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(WRAPPER_NAME)/$(PRODUCT_NAME)',
204                 'INFOPLIST_FILE': 'app/framework-Info.plist',
206                 # Define the order of symbols within the framework.  This
207                 # sets -order_file.
208                 'ORDER_FILE': 'app/framework.order',
209               },
210               'sources': [
211                 'app/chrome_command_ids.h',
212                 'app/chrome_dll_resource.h',
213                 'app/chrome_main.cc',
214                 'app/chrome_main_delegate.cc',
215                 'app/chrome_main_delegate.h',
216                 'app/chrome_main_app_mode_mac.mm',
217                 'app/chrome_main_mac.mm',
218                 'app/chrome_main_mac.h',
219               ],
220               'include_dirs': [
221                 '<(grit_out_dir)',
222               ],
223               # TODO(mark): Come up with a fancier way to do this.  It should
224               # only be necessary to list framework-Info.plist once, not the
225               # three times it is listed here.
226               'mac_bundle_resources': [
227                 # This image is used to badge the lock icon in the
228                 # authentication dialogs, such as those used for installation
229                 # from disk image and Keystone promotion (if so enabled).  It
230                 # needs to exist as a file on disk and not just something in a
231                 # resource bundle because that's the interface that
232                 # Authorization Services uses.  Also, Authorization Services
233                 # can't deal with .icns files.
234                 'app/theme/<(theme_dir_name)/product_logo_32.png',
236                 'app/framework-Info.plist',
237                 'app/nibs/AboutIPC.xib',
238                 'app/nibs/AvatarMenuItem.xib',
239                 'app/nibs/BookmarkAllTabs.xib',
240                 'app/nibs/BookmarkBar.xib',
241                 'app/nibs/BookmarkBarFolderWindow.xib',
242                 'app/nibs/BookmarkBubble.xib',
243                 'app/nibs/BookmarkEditor.xib',
244                 'app/nibs/BookmarkNameFolder.xib',
245                 'app/nibs/BrowserWindow.xib',
246                 'app/nibs/ChromeToMobileBubble.xib',
247                 'app/nibs/CollectedCookies.xib',
248                 'app/nibs/CookieDetailsView.xib',
249                 'app/nibs/ContentBlockedCookies.xib',
250                 'app/nibs/ContentBlockedImages.xib',
251                 'app/nibs/ContentBlockedJavaScript.xib',
252                 'app/nibs/ContentBlockedPlugins.xib',
253                 'app/nibs/ContentBlockedPopups.xib',
254                 'app/nibs/ContentBlockedGeolocation.xib',
255                 'app/nibs/DownloadItem.xib',
256                 'app/nibs/DownloadShelf.xib',
257                 'app/nibs/EditSearchEngine.xib',
258                 'app/nibs/ExtensionInstallPrompt.xib',
259                 'app/nibs/ExtensionInstallPromptBundle.xib',
260                 'app/nibs/ExtensionInstallPromptInline.xib',
261                 'app/nibs/ExtensionInstallPromptNoWarnings.xib',
262                 'app/nibs/ExtensionInstalledBubble.xib',
263                 'app/nibs/ExtensionInstalledBubbleBundle.xib',
264                 'app/nibs/FindBar.xib',
265                 'app/nibs/FirstRunBubble.xib',
266                 'app/nibs/FirstRunDialog.xib',
267                 'app/nibs/FullscreenExitBubble.xib',
268                 'app/nibs/GlobalErrorBubble.xib',
269                 'app/nibs/HungRendererDialog.xib',
270                 'app/nibs/HttpAuthLoginSheet.xib',
271                 'app/nibs/ImportProgressDialog.xib',
272                 'app/nibs/InfoBar.xib',
273                 'app/nibs/InfoBarContainer.xib',
274                 'app/nibs/MainMenu.xib',
275                 'app/nibs/Notification.xib',
276                 'app/nibs/OneClickSigninBubble.xib',
277                 'app/nibs/OneClickSigninDialog.xib',
278                 'app/nibs/Panel.xib',
279                 'app/nibs/PreviewableContents.xib',
280                 'app/nibs/SaveAccessoryView.xib',
281                 'app/nibs/SadTab.xib',
282                 'app/nibs/SpeechRecognitionBubble.xib',
283                 'app/nibs/TabView.xib',
284                 'app/nibs/TaskManager.xib',
285                 'app/nibs/Toolbar.xib',
286                 'app/nibs/WrenchMenu.xib',
287                 'app/theme/balloon_wrench.pdf',
288                 'app/theme/chevron.pdf',
289                 'app/theme/find_next_Template.pdf',
290                 'app/theme/find_prev_Template.pdf',
291                 'app/theme/menu_hierarchy_arrow.pdf',
292                 'app/theme/menu_overflow_down.pdf',
293                 'app/theme/menu_overflow_up.pdf',
294                 'app/theme/nav.pdf',
295                 'app/theme/omnibox_extension_app.pdf',
296                 'app/theme/omnibox_history.pdf',
297                 'app/theme/omnibox_http.pdf',
298                 'app/theme/omnibox_https_invalid.pdf',
299                 'app/theme/omnibox_https_valid.pdf',
300                 'app/theme/omnibox_https_warning.pdf',
301                 'app/theme/omnibox_search.pdf',
302                 'app/theme/omnibox_tts.pdf',
303                 'app/theme/otr_icon.pdf',
304                 'app/theme/star.pdf',
305                 'app/theme/star_lit.pdf',
306                 'browser/mac/install.sh',
307                  '<(SHARED_INTERMEDIATE_DIR)/repack/chrome.pak',
308                  '<(SHARED_INTERMEDIATE_DIR)/repack/resources.pak',
309                 '<!@pymod_do_main(repack_locales -o -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(locales))',
310                 # Note: pseudo_locales are generated via the packed_resources
311                 # dependency but not copied to the final target.  See
312                 # common.gypi for more info.
313               ],
314               'mac_bundle_resources!': [
315                 'app/framework-Info.plist',
316               ],
317               'dependencies': [
318                 'app_mode_app',
319                 # Bring in pdfsqueeze and run it on all pdfs
320                 '../build/temp_gyp/pdfsqueeze.gyp:pdfsqueeze',
321                 '../crypto/crypto.gyp:crypto',
322                 # On Mac, Flash gets put into the framework, so we need this
323                 # dependency here. flash_player.gyp will copy the Flash bundle
324                 # into PRODUCT_DIR.
325                 # TODO(viettrungluu): Once enabled for Mac, Flapper binaries
326                 # will also need to be put into the bundle.
327                 '../third_party/adobe/flash/flash_player.gyp:flash_player',
328                 '../third_party/adobe/flash/flash_player.gyp:flapper_binaries',
329                 'chrome_resources.gyp:packed_extra_resources',
330                 'chrome_resources.gyp:packed_resources',
331               ],
332               'rules': [
333                 {
334                   'rule_name': 'pdfsqueeze',
335                   'extension': 'pdf',
336                   'inputs': [
337                     '<(PRODUCT_DIR)/pdfsqueeze',
338                   ],
339                   'outputs': [
340                     '<(INTERMEDIATE_DIR)/pdfsqueeze/<(RULE_INPUT_ROOT).pdf',
341                   ],
342                   'action': ['<(PRODUCT_DIR)/pdfsqueeze',
343                              '<(RULE_INPUT_PATH)', '<@(_outputs)'],
344                   'message': 'Running pdfsqueeze on <(RULE_INPUT_PATH)',
345                 },
346               ],
347               'variables': {
348                 'conditions': [
349                   ['branding=="Chrome"', {
350                     'theme_dir_name': 'google_chrome',
351                   }, {  # else: 'branding!="Chrome"
352                     'theme_dir_name': 'chromium',
353                   }],
354                 ],
355                 'repack_path': '../tools/grit/grit/format/repack.py',
356               },
357               'actions': [
358                 {
359                   'includes': ['chrome_repack_theme_resources_2x.gypi']
360                 },
361               ],
362               'postbuilds': [
363                 {
364                   # This step causes an error to be raised if the .order file
365                   # does not account for all global text symbols.  It
366                   # validates the completeness of the .order file.
367                   'postbuild_name': 'Verify global text symbol order',
368                   'variables': {
369                     'verify_order_path': 'tools/build/mac/verify_order',
370                   },
371                   'action': [
372                     '<(verify_order_path)',
373                     '_ChromeMain',
374                     '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}',
375                   ],
376                 },
377                 {
378                   # Modify the Info.plist as needed.  The script explains why
379                   # this is needed.  This is also done in the chrome target.
380                   # The framework needs the Breakpad keys if this feature is
381                   # enabled.  It does not need the Keystone keys; these always
382                   # come from the outer application bundle.  The framework
383                   # doesn't currently use the Subversion keys for anything,
384                   # but this seems like a really good place to store them.
385                   'postbuild_name': 'Tweak Info.plist',
386                   'action': ['<(tweak_info_plist_path)',
387                              '--breakpad=<(mac_breakpad_compiled_in)',
388                              '--breakpad_uploads=<(mac_breakpad_uploads)',
389                              '--keystone=0',
390                              '--svn=1',
391                              '--branding=<(branding)'],
392                 },
393                 {
394                   'postbuild_name': 'Symlink Libraries',
395                   'action': [
396                     'ln',
397                     '-fhs',
398                     'Versions/Current/Libraries',
399                     '${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Libraries'
400                   ],
401                 },
402               ],
403               'copies': [
404                 {
405                   # Copy FFmpeg binaries for audio/video support.
406                   'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
407                   'files': [
408                     '<(PRODUCT_DIR)/ffmpegsumo.so',
409                   ],
410                 },
411                 {
412                   'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Internet Plug-Ins',
413                   'files': [],
414                   'conditions': [
415                     ['branding == "Chrome"', {
416                       'files': [
417                         '<(PRODUCT_DIR)/Flash Player Plugin for Chrome.plugin',
418                         '<(PRODUCT_DIR)/plugin.vch',
419                       ],
420                     }],
421                     ['internal_pdf', {
422                       'files': [
423                         '<(PRODUCT_DIR)/PDF.plugin',
424                       ],
425                     }],
426                     ['disable_nacl!=1', {
427                       'files': [
428                         '<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.plugin',
429                         # We leave out nacl_irt_x86_64.nexe because we only
430                         # support x86-32 NaCl on Mac OS X.
431                         '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
432                       ],
433                     }],
434                   ],
435                 },
436                 {
437                   # Copy of resources used by tests.
438                   'destination': '<(PRODUCT_DIR)',
439                   'files': [
440                       '<(SHARED_INTERMEDIATE_DIR)/repack/resources.pak'
441                   ],
442                 },
443                 {
444                   # Copy of resources used by tests.
445                   'destination': '<(PRODUCT_DIR)/pseudo_locales',
446                   'files': [
447                       '<(SHARED_INTERMEDIATE_DIR)/<(pseudo_locales).pak'
448                   ],
449                 },
450                 {
451                   'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/resources',
452                   'files': [
453                     # Loader bundle for platform apps.
454                     '<(PRODUCT_DIR)/app_mode_loader.app',
455                   ],
456                   'conditions': [
457                     ['debug_devtools!=0', {
458                       'files': [
459                          '<(PRODUCT_DIR)/resources/inspector',
460                       ],
461                     }],
462                   ],
463                 },
464               ],
465               'conditions': [
466                 ['branding=="Chrome"', {
467                   'copies': [
468                     {
469                       # This location is for the Mac build. Note that the
470                       # copying of these files for Windows and Linux is handled
471                       # in chrome.gyp, as Mac needs to be dropped inside the
472                       # framework.
473                       'destination':
474                           '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Default Apps',
475                       'files': ['<@(default_apps_list)'],
476                     },
477                   ],
478                 }],
479                 ['mac_breakpad==1', {
480                   'variables': {
481                     # A real .dSYM is needed for dump_syms to operate on.
482                     'mac_real_dsym': 1,
483                   },
484                 }],
485                 ['mac_breakpad_compiled_in==1', {
486                   'sources': [
487                     'app/breakpad_mac.mm',
488                     'app/breakpad_mac.h',
489                   ],
490                   'dependencies': [
491                     '../breakpad/breakpad.gyp:breakpad',
492                     'app/policy/cloud_policy_codegen.gyp:policy',
493                   ],
494                   'copies': [
495                     {
496                       'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Resources',
497                       'files': [
498                         '<(PRODUCT_DIR)/crash_inspector',
499                         '<(PRODUCT_DIR)/crash_report_sender.app'
500                       ],
501                     },
502                   ],
503                 }, {  # else: mac_breakpad_compiled_in!=1
504                   # No Breakpad, put in the stubs.
505                   'sources': [
506                     'app/breakpad_mac_stubs.mm',
507                     'app/breakpad_mac.h',
508                   ],
509                 }],  # mac_breakpad_compiled_in
510                 ['mac_keystone==1', {
511                   'mac_bundle_resources': [
512                     'browser/mac/keystone_promote_preflight.sh',
513                     'browser/mac/keystone_promote_postflight.sh',
514                   ],
515                   'postbuilds': [
516                     {
517                       'postbuild_name': 'Copy KeystoneRegistration.framework',
518                       'action': [
519                         '../build/mac/copy_framework_unversioned.sh',
520                         '../third_party/googlemac/Releases/Keystone/KeystoneRegistration.framework',
521                         '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Frameworks',
522                       ],
523                     },
524                     {
525                       'postbuild_name': 'Symlink Frameworks',
526                       'action': [
527                         'ln',
528                         '-fhs',
529                         'Versions/Current/Frameworks',
530                         '${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Frameworks'
531                       ],
532                     },
533                   ],
534                 }],  # mac_keystone
535                 ['internal_pdf', {
536                   'dependencies': [
537                     '../pdf/pdf.gyp:pdf',
538                   ],
539                 }],
540               ],  # conditions
541             }],  # OS=="mac"
542           ],  # conditions
543         },  # target chrome_dll
544       ],  # targets
545     }],  # OS=="mac" or OS=="win"
546   ],