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