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