Extract SIGPIPE ignoring code to a common place.
[chromium-blink-merge.git] / chrome / chrome_dll.gypi
blobd39ab36356c8d7da39ced452ccfd32d6bd3f3bc8
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/compositor/compositor.gyp:compositor',
54               ],
55             }],
56             ['use_ash==1', {
57               'sources': [
58                 '<(SHARED_INTERMEDIATE_DIR)/ash/ash_resources/ash_wallpaper_resources.rc',
59               ],
60             }],
61             ['OS=="win"', {
62               'product_name': 'chrome',
63               'dependencies': [
64                 # On Windows, link the dependencies (libraries) that make
65                 # up actual Chromium functionality into this .dll.
66                 'chrome_resources.gyp:chrome_resources',
67                 'chrome_version_resources',
68                 '../chrome/chrome_resources.gyp:chrome_unscaled_resources',
69                 '../content/content.gyp:content_worker',
70                 '../crypto/crypto.gyp:crypto',
71                 '../printing/printing.gyp:printing',
72                 '../net/net.gyp:net_resources',
73                 '../third_party/cld/cld.gyp:cld',
74                 '../ui/views/views.gyp:views',
75                 '../webkit/support/webkit_support.gyp:webkit_resources',
76               ],
77               'sources': [
78                 'app/chrome_command_ids.h',
79                 'app/chrome_dll.rc',
80                 'app/chrome_dll_resource.h',
81                 'app/chrome_main.cc',
82                 'app/chrome_main_delegate.cc',
83                 'app/chrome_main_delegate.h',
85                 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
86                 '../base/win/dllmain.cc',
88                 '../webkit/glue/resources/aliasb.cur',
89                 '../webkit/glue/resources/cell.cur',
90                 '../webkit/glue/resources/col_resize.cur',
91                 '../webkit/glue/resources/copy.cur',
92                 '../webkit/glue/resources/none.cur',
93                 '../webkit/glue/resources/row_resize.cur',
94                 '../webkit/glue/resources/vertical_text.cur',
95                 '../webkit/glue/resources/zoom_in.cur',
96                 '../webkit/glue/resources/zoom_out.cur',
98                 # TODO:  It would be nice to have these pulled in
99                 # automatically from direct_dependent_settings in
100                 # their various targets (net.gyp:net_resources, etc.),
101                 # but that causes errors in other targets when
102                 # resulting .res files get referenced multiple times.
103                 '<(SHARED_INTERMEDIATE_DIR)/chrome/browser_resources.rc',
104                 '<(SHARED_INTERMEDIATE_DIR)/chrome/chrome_unscaled_resources.rc',
105                 '<(SHARED_INTERMEDIATE_DIR)/chrome/common_resources.rc',
106                 '<(SHARED_INTERMEDIATE_DIR)/chrome/extensions_api_resources.rc',
107                 '<(SHARED_INTERMEDIATE_DIR)/chrome/renderer_resources.rc',
108                 '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.rc',
109                 '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
110                 '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc',
111                 '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.rc',
113                 # TODO(sgk):  left-over from pre-gyp build, figure out
114                 # if we still need them and/or how to update to gyp.
115                 #'app/check_dependents.bat',
116                 #'app/chrome.dll.deps',
117               ],
118               'include_dirs': [
119                 '<(DEPTH)/third_party/wtl/include',
120               ],
121               'defines': [
122                 'CHROME_DLL',
123                 'BROWSER_DLL',
124                 'RENDERER_DLL',
125                 'PLUGIN_DLL',
126               ],
127               'configurations': {
128                 'Debug_Base': {
129                   'msvs_settings': {
130                     'VCLinkerTool': {
131                       'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
132                     },
133                   },
134                 },
135               },
136               'msvs_settings': {
137                 'VCLinkerTool': {
138                   'AdditionalLibraryDirectories': ['$(DXSDK_DIR)/lib/x86'],
139                   'BaseAddress': '0x01c30000',
140                   'ImportLibrary': '$(OutDir)\\lib\\chrome_dll.lib',
141                   'ProgramDatabaseFile': '$(OutDir)\\chrome_dll.pdb',
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                   ],
150                   'DelayLoadDLLs': [
151                     'comdlg32.dll',
152                     'crypt32.dll',
153                     'cryptui.dll',
154                     'dhcpcsvc.dll',
155                     'imagehlp.dll',
156                     'imm32.dll',
157                     'iphlpapi.dll',
158                     'setupapi.dll',
159                     'urlmon.dll',
160                     'winhttp.dll',
161                     'wininet.dll',
162                     'winspool.drv',
163                     'ws2_32.dll',
164                     'wsock32.dll',
165                   ],
166                 },
167                 'VCManifestTool': {
168                   'AdditionalManifestFiles': '$(ProjectDir)\\app\\chrome.dll.manifest',
169                 },
170               },
171             }],  # OS=="win"
172             ['OS=="mac"', {
173              'includes': [ 'chrome_dll_bundle.gypi' ],
174               'xcode_settings': {
175                 # Define the order of symbols within the framework.  This
176                 # sets -order_file.
177                 'ORDER_FILE': 'app/framework.order',
178               },
179               'sources': [
180                 'app/chrome_command_ids.h',
181                 'app/chrome_dll_resource.h',
182                 'app/chrome_main.cc',
183                 'app/chrome_main_delegate.cc',
184                 'app/chrome_main_delegate.h',
185                 'app/chrome_main_app_mode_mac.mm',
186                 'app/chrome_main_mac.mm',
187                 'app/chrome_main_mac.h',
188               ],
189               'include_dirs': [
190                 '<(grit_out_dir)',
191               ],
192               'postbuilds': [
193                 {
194                   # This step causes an error to be raised if the .order file
195                   # does not account for all global text symbols.  It
196                   # validates the completeness of the .order file.
197                   'postbuild_name': 'Verify global text symbol order',
198                   'variables': {
199                     'verify_order_path': 'tools/build/mac/verify_order',
200                   },
201                   'action': [
202                     '<(verify_order_path)',
203                     '_ChromeMain',
204                     '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}',
205                   ],
206                 },
207               ],
208               'conditions': [
209                 ['mac_breakpad_compiled_in==1', {
210                   'dependencies': [
211                     '../breakpad/breakpad.gyp:breakpad',
212                     'app/policy/cloud_policy_codegen.gyp:policy',
213                   ],
214                   'sources': [
215                     'app/breakpad_mac.mm',
216                     'app/breakpad_mac.h',
217                   ],
218                 }, {  # else: mac_breakpad_compiled_in!=1
219                   # No Breakpad, put in the stubs.
220                   'sources': [
221                     'app/breakpad_mac_stubs.mm',
222                     'app/breakpad_mac.h',
223                   ],
224                 }],  # mac_breakpad_compiled_in
225                 ['internal_pdf', {
226                   'dependencies': [
227                     '../pdf/pdf.gyp:pdf',
228                   ],
229                 }],
230               ],  # conditions
231             }],  # OS=="mac"
232           ],  # conditions
233         },  # target chrome_dll
234       ],  # targets
235     }],  # OS=="mac" or OS=="win"
236   ],