Null deref under WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground
[WebKit-https.git] / Source / WebKit / PlatformWin.cmake
1 if (${WTF_PLATFORM_WIN_CAIRO})
2     add_definitions(-DUSE_CAIRO=1 -DUSE_CURL=1 -DWEBKIT_EXPORTS=1)
3     list(APPEND WebKit_INCLUDE_DIRECTORIES
4         ${CAIRO_INCLUDE_DIRS}
5         "${WEBKIT_LIBRARIES_DIR}/include"
6         "${WEBKIT_LIBRARIES_DIR}/include/sqlite"
7         "${WEBCORE_DIR}/platform/graphics/cairo"
8     )
9     list(APPEND WebKit_SOURCES_Classes
10         win/WebDownloadCURL.cpp
11         win/WebURLAuthenticationChallengeSenderCURL.cpp
12     )
13     list(APPEND WebKit_LIBRARIES
14         PRIVATE libeay32.lib
15         PRIVATE mfuuid.lib
16         PRIVATE ssleay32.lib
17         PRIVATE strmiids.lib
18     )
19 else ()
20     list(APPEND WebKit_SOURCES_Classes
21         win/WebDownloadCFNet.cpp
22         win/WebURLAuthenticationChallengeSenderCFNet.cpp
23     )
24     list(APPEND WebKit_LIBRARIES
25         PRIVATE CFNetwork${DEBUG_SUFFIX}
26         PRIVATE CoreFoundation${DEBUG_SUFFIX}
27         PRIVATE CoreGraphics${DEBUG_SUFFIX}
28         PRIVATE CoreText${DEBUG_SUFFIX}
29         PRIVATE QuartzCore${DEBUG_SUFFIX}
30         PRIVATE SQLite3${DEBUG_SUFFIX}
31         PRIVATE WebKitSystemInterface${DEBUG_SUFFIX}
32         PRIVATE libdispatch${DEBUG_SUFFIX}
33         PRIVATE libicuin${DEBUG_SUFFIX}
34         PRIVATE libicuuc${DEBUG_SUFFIX}
35         PRIVATE libxml2${DEBUG_SUFFIX}
36         PRIVATE libxslt${DEBUG_SUFFIX}
37         PRIVATE zdll${DEBUG_SUFFIX}
38     )
39 endif ()
40
41 list(APPEND WebKit_LIBRARIES PRIVATE WTF${DEBUG_SUFFIX})
42
43 add_custom_command(
44     OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/WebKitVersion.h
45     MAIN_DEPENDENCY ${WEBKIT_DIR}/scripts/generate-webkitversion.pl
46     DEPENDS ${WEBKIT_DIR}/mac/Configurations/Version.xcconfig
47     COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/scripts/generate-webkitversion.pl --config ${WEBKIT_DIR}/mac/Configurations/Version.xcconfig --outputDir ${DERIVED_SOURCES_WEBKIT_DIR}
48     VERBATIM)
49 list(APPEND WebKit_SOURCES ${DERIVED_SOURCES_WEBKIT_DIR}/WebKitVersion.h)
50
51 list(APPEND WebKit_INCLUDE_DIRECTORIES
52     "${CMAKE_BINARY_DIR}/../include/private"
53     "${CMAKE_BINARY_DIR}/../include/private/JavaScriptCore"
54     "${CMAKE_BINARY_DIR}/../include/private/WebCore"
55     "${WEBKIT_DIR}/win"
56     "${WEBKIT_DIR}/win/plugins"
57     "${WEBKIT_DIR}/win/WebCoreSupport"
58     "${DERIVED_SOURCES_WEBKIT_DIR}/include"
59     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces"
60     "${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE"
61     "${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include"
62     "${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include/egl"
63     "${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include/khr"
64     "${DERIVED_SOURCES_DIR}/WebKit"
65 )
66
67 list(APPEND WebKit_INCLUDES
68     win/CFDictionaryPropertyBag.h
69     win/COMEnumVariant.h
70     win/COMPropertyBag.h
71     win/COMVariantSetter.h
72     win/CodeAnalysisConfig.h
73     win/DOMCSSClasses.h
74     win/DOMCoreClasses.h
75     win/DOMEventsClasses.h
76     win/DOMHTMLClasses.h
77     win/DefaultDownloadDelegate.h
78     win/DefaultPolicyDelegate.h
79     win/ForEachCoClass.h
80     win/FullscreenVideoController.h
81     win/MarshallingHelpers.h
82     win/MemoryStream.h
83     win/ProgIDMacros.h
84     win/WebActionPropertyBag.h
85     win/WebApplicationCache.h
86     win/WebArchive.h
87     win/WebBackForwardList.h
88     win/WebCache.h
89     win/WebCachedFramePlatformData.h
90     win/WebCoreStatistics.h
91     win/WebDataSource.h
92     win/WebDatabaseManager.h
93     win/WebDocumentLoader.h
94     win/WebDownload.h
95     win/WebDropSource.h
96     win/WebElementPropertyBag.h
97     win/WebError.h
98     win/WebFrame.h
99     win/WebFramePolicyListener.h
100     win/WebGeolocationPolicyListener.h
101     win/WebGeolocationPosition.h
102     win/WebHTMLRepresentation.h
103     win/WebHistory.h
104     win/WebHistoryItem.h
105     win/WebIconDatabase.h
106     win/WebJavaScriptCollector.h
107     win/WebKitCOMAPI.h
108     win/WebKitClassFactory.h
109     win/WebKitDLL.h
110     win/WebKitGraphics.h
111     win/WebKitLogging.h
112     win/WebKitStatistics.h
113     win/WebKitStatisticsPrivate.h
114     win/WebKitSystemBits.h
115     win/WebLocalizableStrings.h
116     win/WebMutableURLRequest.h
117     win/WebNavigationData.h
118     win/WebNotification.h
119     win/WebNotificationCenter.h
120     win/WebPreferenceKeysPrivate.h
121     win/WebPreferences.h
122     win/WebResource.h
123     win/WebScriptObject.h
124     win/WebScriptWorld.h
125     win/WebSecurityOrigin.h
126     win/WebSerializedJSValue.h
127     win/WebTextRenderer.h
128     win/WebURLAuthenticationChallenge.h
129     win/WebURLAuthenticationChallengeSender.h
130     win/WebURLCredential.h
131     win/WebURLProtectionSpace.h
132     win/WebURLResponse.h
133     win/WebUserContentURLPattern.h
134     win/WebView.h
135     win/WebWorkersPrivate.h
136 )
137
138 list(APPEND WebKit_SOURCES_Classes
139     cf/WebCoreSupport/WebInspectorClientCF.cpp
140
141     win/AccessibleBase.cpp
142     win/AccessibleDocument.cpp
143     win/AccessibleImage.cpp
144     win/AccessibleTextImpl.cpp
145     win/BackForwardList.cpp
146     win/CFDictionaryPropertyBag.cpp
147     win/DOMCSSClasses.cpp
148     win/DOMCoreClasses.cpp
149     win/DOMEventsClasses.cpp
150     win/DOMHTMLClasses.cpp
151     win/DefaultDownloadDelegate.cpp
152     win/DefaultPolicyDelegate.cpp
153     win/ForEachCoClass.cpp
154     win/FullscreenVideoController.cpp
155     win/MarshallingHelpers.cpp
156     win/MemoryStream.cpp
157     win/WebActionPropertyBag.cpp
158     win/WebApplicationCache.cpp
159     win/WebArchive.cpp
160     win/WebBackForwardList.cpp
161     win/WebCache.cpp
162     win/WebCoreStatistics.cpp
163     win/WebDataSource.cpp
164     win/WebDatabaseManager.cpp
165     win/WebDocumentLoader.cpp
166     win/WebDownload.cpp
167     win/WebDropSource.cpp
168     win/WebElementPropertyBag.cpp
169     win/WebError.cpp
170     win/WebFrame.cpp
171     win/WebFramePolicyListener.cpp
172     win/WebGeolocationPolicyListener.cpp
173     win/WebGeolocationPosition.cpp
174     win/WebHTMLRepresentation.cpp
175     win/WebHistory.cpp
176     win/WebHistoryItem.cpp
177     win/WebIconDatabase.cpp
178     win/WebInspector.cpp
179     win/WebJavaScriptCollector.cpp
180     win/WebKitCOMAPI.cpp
181     win/WebKitClassFactory.cpp
182     win/WebKitDLL.cpp
183     win/WebKitLogging.cpp
184     win/WebKitMessageLoop.cpp
185     win/WebKitStatistics.cpp
186     win/WebKitSystemBits.cpp
187     win/WebLocalizableStrings.cpp
188     win/WebMutableURLRequest.cpp
189     win/WebNavigationData.cpp
190     win/WebNodeHighlight.cpp
191     win/WebNotification.cpp
192     win/WebNotificationCenter.cpp
193     win/WebPreferences.cpp
194     win/WebResource.cpp
195     win/WebScriptObject.cpp
196     win/WebScriptWorld.cpp
197     win/WebSecurityOrigin.cpp
198     win/WebSerializedJSValue.cpp
199     win/WebTextRenderer.cpp
200     win/WebURLAuthenticationChallenge.cpp
201     win/WebURLAuthenticationChallengeSender.cpp
202     win/WebURLCredential.cpp
203     win/WebURLProtectionSpace.cpp
204     win/WebURLResponse.cpp
205     win/WebUserContentURLPattern.cpp
206     win/WebView.cpp
207     win/WebWorkersPrivate.cpp
208
209     win/plugins/PluginDatabase.cpp
210     win/plugins/PluginDatabaseWin.cpp
211     win/plugins/PluginDebug.cpp
212     win/plugins/PluginMainThreadScheduler.cpp
213     win/plugins/PluginMessageThrottlerWin.cpp
214     win/plugins/PluginPackage.cpp
215     win/plugins/PluginPackageWin.cpp
216     win/plugins/PluginStream.cpp
217     win/plugins/PluginView.cpp
218     win/plugins/PluginViewWin.cpp
219     win/plugins/npapi.cpp
220
221     win/storage/WebDatabaseProvider.cpp
222 )
223
224 list(APPEND WebKit_SOURCES_WebCoreSupport
225     win/WebCoreSupport/AcceleratedCompositingContext.cpp
226     win/WebCoreSupport/EmbeddedWidget.cpp
227     win/WebCoreSupport/EmbeddedWidget.h
228     win/WebCoreSupport/WebChromeClient.cpp
229     win/WebCoreSupport/WebChromeClient.h
230     win/WebCoreSupport/WebContextMenuClient.cpp
231     win/WebCoreSupport/WebContextMenuClient.h
232     win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp
233     win/WebCoreSupport/WebDesktopNotificationsDelegate.h
234     win/WebCoreSupport/WebDragClient.cpp
235     win/WebCoreSupport/WebDragClient.h
236     win/WebCoreSupport/WebEditorClient.cpp
237     win/WebCoreSupport/WebEditorClient.h
238     win/WebCoreSupport/WebFrameLoaderClient.cpp
239     win/WebCoreSupport/WebFrameLoaderClient.h
240     win/WebCoreSupport/WebFrameNetworkingContext.cpp
241     win/WebCoreSupport/WebFrameNetworkingContext.h
242     win/WebCoreSupport/WebGeolocationClient.cpp
243     win/WebCoreSupport/WebGeolocationClient.h
244     win/WebCoreSupport/WebInspectorClient.cpp
245     win/WebCoreSupport/WebInspectorClient.h
246     win/WebCoreSupport/WebInspectorDelegate.cpp
247     win/WebCoreSupport/WebInspectorDelegate.h
248     win/WebCoreSupport/WebPlatformStrategies.cpp
249     win/WebCoreSupport/WebPlatformStrategies.h
250     win/WebCoreSupport/WebPluginInfoProvider.cpp
251     win/WebCoreSupport/WebPluginInfoProvider.h
252     win/WebCoreSupport/WebVisitedLinkStore.cpp
253     win/WebCoreSupport/WebVisitedLinkStore.h
254 )
255
256 if (CMAKE_SIZEOF_VOID_P EQUAL 8)
257     enable_language(ASM_MASM)
258     list(APPEND WebKit_SOURCES
259         win/plugins/PaintHooks.asm
260     )
261 endif ()
262
263 list(APPEND WebKit_SOURCES ${WebKit_INCLUDES} ${WebKit_SOURCES_Classes} ${WebKit_SOURCES_WebCoreSupport})
264
265 source_group(Includes FILES ${WebKit_INCLUDES})
266 source_group(Classes FILES ${WebKit_SOURCES_Classes})
267 source_group(WebCoreSupport FILES ${WebKit_SOURCES_WebCoreSupport})
268
269 # Build the COM interface:
270 macro(GENERATE_INTERFACE _infile _defines _depends)
271     get_filename_component(_filewe ${_infile} NAME_WE)
272     add_custom_command(
273         OUTPUT  ${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/${_filewe}.h
274         MAIN_DEPENDENCY ${_infile}
275         DEPENDS ${_depends}
276         COMMAND midl.exe /I "${CMAKE_CURRENT_SOURCE_DIR}/win/Interfaces" /I "${CMAKE_CURRENT_SOURCE_DIR}/win/Interfaces/Accessible2" /I "${DERIVED_SOURCES_WEBKIT_DIR}/include" /I "${CMAKE_CURRENT_SOURCE_DIR}/win" /WX /char signed /env win32 /tlb "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_filewe}.tlb" /out "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces" /h "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/${_filewe}.h" /iid "${_filewe}_i.c" ${_defines} "${CMAKE_CURRENT_SOURCE_DIR}/${_infile}"
277         VERBATIM)
278     set_source_files_properties(${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/${_filewe}.h PROPERTIES GENERATED TRUE)
279     set_source_files_properties(${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/${_filewe}_i.c PROPERTIES GENERATED TRUE)
280 endmacro()
281
282 set(MIDL_DEFINES /D\ \"__PRODUCTION__=01\")
283
284 set(WEBKIT_IDL_DEPENDENCIES
285     win/Interfaces/AccessibleComparable.idl
286     win/Interfaces/DOMCSS.idl
287     win/Interfaces/DOMCore.idl
288     win/Interfaces/DOMEvents.idl
289     win/Interfaces/DOMExtensions.idl
290     win/Interfaces/DOMHTML.idl
291     win/Interfaces/DOMPrivate.idl
292     win/Interfaces/DOMRange.idl
293     win/Interfaces/DOMWindow.idl
294     win/Interfaces/IGEN_DOMObject.idl
295     win/Interfaces/IWebArchive.idl
296     win/Interfaces/IWebBackForwardList.idl
297     win/Interfaces/IWebBackForwardListPrivate.idl
298     win/Interfaces/IWebCache.idl
299     win/Interfaces/IWebCoreStatistics.idl
300     win/Interfaces/IWebDataSource.idl
301     win/Interfaces/IWebDatabaseManager.idl
302     win/Interfaces/IWebDesktopNotificationsDelegate.idl
303     win/Interfaces/IWebDocument.idl
304     win/Interfaces/IWebDownload.idl
305     win/Interfaces/IWebEditingDelegate.idl
306     win/Interfaces/IWebEmbeddedView.idl
307     win/Interfaces/IWebError.idl
308     win/Interfaces/IWebErrorPrivate.idl
309     win/Interfaces/IWebFormDelegate.idl
310     win/Interfaces/IWebFrame.idl
311     win/Interfaces/IWebFrameLoadDelegate.idl
312     win/Interfaces/IWebFrameLoadDelegatePrivate.idl
313     win/Interfaces/IWebFrameLoadDelegatePrivate2.idl
314     win/Interfaces/IWebFramePrivate.idl
315     win/Interfaces/IWebFrameView.idl
316     win/Interfaces/IWebGeolocationPolicyListener.idl
317     win/Interfaces/IWebGeolocationPosition.idl
318     win/Interfaces/IWebGeolocationProvider.idl
319     win/Interfaces/IWebHTMLRepresentation.idl
320     win/Interfaces/IWebHTTPURLResponse.idl
321     win/Interfaces/IWebHistory.idl
322     win/Interfaces/IWebHistoryDelegate.idl
323     win/Interfaces/IWebHistoryItem.idl
324     win/Interfaces/IWebHistoryItemPrivate.idl
325     win/Interfaces/IWebHistoryPrivate.idl
326     win/Interfaces/IWebIconDatabase.idl
327     win/Interfaces/IWebInspector.idl
328     win/Interfaces/IWebInspectorPrivate.idl
329     win/Interfaces/IWebJavaScriptCollector.idl
330     win/Interfaces/IWebKitStatistics.idl
331     win/Interfaces/IWebMutableURLRequest.idl
332     win/Interfaces/IWebMutableURLRequestPrivate.idl
333     win/Interfaces/IWebNavigationData.idl
334     win/Interfaces/IWebNotification.idl
335     win/Interfaces/IWebNotificationCenter.idl
336     win/Interfaces/IWebNotificationObserver.idl
337     win/Interfaces/IWebPolicyDelegate.idl
338     win/Interfaces/IWebPolicyDelegatePrivate.idl
339     win/Interfaces/IWebPreferences.idl
340     win/Interfaces/IWebPreferencesPrivate.idl
341     win/Interfaces/IWebResource.idl
342     win/Interfaces/IWebResourceLoadDelegate.idl
343     win/Interfaces/IWebResourceLoadDelegatePrivate.idl
344     win/Interfaces/IWebResourceLoadDelegatePrivate2.idl
345     win/Interfaces/IWebScriptObject.idl
346     win/Interfaces/IWebScriptWorld.idl
347     win/Interfaces/IWebSecurityOrigin.idl
348     win/Interfaces/IWebSerializedJSValue.idl
349     win/Interfaces/IWebSerializedJSValuePrivate.idl
350     win/Interfaces/IWebTextRenderer.idl
351     win/Interfaces/IWebUIDelegate.idl
352     win/Interfaces/IWebUIDelegate2.idl
353     win/Interfaces/IWebUIDelegatePrivate.idl
354     win/Interfaces/IWebURLAuthenticationChallenge.idl
355     win/Interfaces/IWebURLRequest.idl
356     win/Interfaces/IWebURLResponse.idl
357     win/Interfaces/IWebURLResponsePrivate.idl
358     win/Interfaces/IWebUndoManager.idl
359     win/Interfaces/IWebUndoTarget.idl
360     win/Interfaces/IWebUserContentURLPattern.idl
361     win/Interfaces/IWebView.idl
362     win/Interfaces/IWebViewPrivate.idl
363     win/Interfaces/IWebWorkersPrivate.idl
364     win/Interfaces/JavaScriptCoreAPITypes.idl
365     win/Interfaces/WebKit.idl
366     win/Interfaces/WebScrollbarTypes.idl
367
368     win/Interfaces/Accessible2/Accessible2.idl
369     win/Interfaces/Accessible2/Accessible2_2.idl
370     win/Interfaces/Accessible2/AccessibleApplication.idl
371     win/Interfaces/Accessible2/AccessibleEditableText.idl
372     win/Interfaces/Accessible2/AccessibleRelation.idl
373     win/Interfaces/Accessible2/AccessibleStates.idl
374     win/Interfaces/Accessible2/AccessibleText.idl
375     win/Interfaces/Accessible2/AccessibleText2.idl
376     win/Interfaces/Accessible2/IA2CommonTypes.idl
377     "${DERIVED_SOURCES_WEBKIT_DIR}/include/autoversion.h"
378 )
379
380 add_custom_command(
381     OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/include/autoversion.h
382     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
383     COMMAND ${PERL_EXECUTABLE} ${WEBKIT_LIBRARIES_DIR}/tools/scripts/auto-version.pl ${DERIVED_SOURCES_WEBKIT_DIR}
384     VERBATIM)
385
386 GENERATE_INTERFACE(win/Interfaces/WebKit.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
387 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleApplication.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
388 GENERATE_INTERFACE(win/Interfaces/Accessible2/Accessible2.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
389 GENERATE_INTERFACE(win/Interfaces/Accessible2/Accessible2_2.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
390 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleRelation.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
391 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleStates.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
392 GENERATE_INTERFACE(win/Interfaces/Accessible2/IA2CommonTypes.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
393 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleEditableText.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
394 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleText.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
395 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleText2.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
396
397 add_library(WebKitGUID STATIC
398     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/WebKit.h"
399     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleApplication.h"
400     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/Accessible2.h"
401     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/Accessible2_2.h"
402     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleRelation.h"
403     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleStates.h"
404     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/IA2CommonTypes.h"
405     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleEditableText.h"
406     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleText.h"
407     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleText2.h"
408     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/WebKit_i.c"
409     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleApplication_i.c"
410     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/Accessible2_i.c"
411     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/Accessible2_2_i.c"
412     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleRelation_i.c"
413     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleEditableText_i.c"
414     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleText_i.c"
415     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleText2_i.c"
416 )
417 set_target_properties(WebKitGUID PROPERTIES OUTPUT_NAME WebKitGUID${DEBUG_SUFFIX})
418
419 list(APPEND WebKit_LIBRARIES
420     PRIVATE Comctl32
421     PRIVATE Comsupp
422     PRIVATE Crypt32
423     PRIVATE D2d1
424     PRIVATE Dwrite
425     PRIVATE dxguid
426     PRIVATE Iphlpapi
427     PRIVATE Psapi
428     PRIVATE Rpcrt4
429     PRIVATE Shlwapi
430     PRIVATE Usp10
431     PRIVATE Version
432     PRIVATE Winmm
433     PRIVATE WebKitGUID${DEBUG_SUFFIX}
434     PRIVATE WebCoreDerivedSources${DEBUG_SUFFIX}
435     PRIVATE WindowsCodecs
436 )
437
438 if (ENABLE_GRAPHICS_CONTEXT_3D)
439     list(APPEND WebKit_LIBRARIES
440         libANGLE${DEBUG_SUFFIX}
441         libEGL${DEBUG_SUFFIX}
442         libGLESv2${DEBUG_SUFFIX}
443     )
444 endif ()
445
446 set(WebKit_LIBRARY_TYPE SHARED)
447
448 # Make sure incremental linking is turned off, as it creates unacceptably long link times.
449 string(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replace_CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS})
450 set(CMAKE_SHARED_LINKER_FLAGS "${replace_CMAKE_SHARED_LINKER_FLAGS} /INCREMENTAL:NO")
451 string(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replace_CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
452 set(CMAKE_EXE_LINKER_FLAGS "${replace_CMAKE_EXE_LINKER_FLAGS} /INCREMENTAL:NO")
453
454 string(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replace_CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG})
455 set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${replace_CMAKE_SHARED_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO")
456 string(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replace_CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG})
457 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${replace_CMAKE_EXE_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO")
458
459 string(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replace_CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO})
460 set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${replace_CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /INCREMENTAL:NO")
461 string(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replace_CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO})
462 set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${replace_CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /INCREMENTAL:NO")
463
464 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
465 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
466
467 # We need the webkit libraries to come before the system default libraries to prevent symbol conflicts with uuid.lib.
468 # To do this we add system default libs as webkit libs and zero out system default libs.
469 string(REPLACE " " "\;" CXX_LIBS ${CMAKE_CXX_STANDARD_LIBRARIES})
470 list(APPEND WebKit_LIBRARIES ${CXX_LIBS})
471 set(CMAKE_CXX_STANDARD_LIBRARIES "")
472
473 if (${WTF_PLATFORM_WIN_CAIRO})
474     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:LIBCMTD")
475 else ()
476     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:MSVCRT /NODEFAULTLIB:MSVCRTD")
477 endif ()
478
479 # If this directory isn't created before midl runs and attempts to output WebKit.tlb,
480 # It fails with an unusual error - midl failed - failed to save all changes
481 file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
482 file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces)
483
484 set(WebKitGUID_PRE_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/WebKit/preBuild.cmd")
485 file(WRITE "${WebKitGUID_PRE_BUILD_COMMAND}" "@xcopy /y /d /f \"${CMAKE_CURRENT_SOURCE_DIR}/win/WebKitCOMAPI.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKit\" >nul 2>nul\n@xcopy /y /d /f \"${CMAKE_CURRENT_SOURCE_DIR}/win/CFDictionaryPropertyBag.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKit\" >nul 2>nul\n")
486 file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKit)
487 add_custom_command(TARGET WebKitGUID PRE_BUILD COMMAND ${WebKitGUID_PRE_BUILD_COMMAND} VERBATIM)
488
489 set(WebKitGUID_POST_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/WebKit/postBuild.cmd")
490 file(WRITE "${WebKitGUID_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKit\" >nul 2>nul")
491 add_custom_command(TARGET WebKitGUID POST_BUILD COMMAND ${WebKitGUID_POST_BUILD_COMMAND} VERBATIM)
492
493 set(WebKit_OUTPUT_NAME
494     WebKit${DEBUG_SUFFIX}
495 )