[cmake] Set library types before their targets are created
[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         "${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         ${OPENSSL_LIBRARIES}
15         PRIVATE mfuuid.lib
16         PRIVATE strmiids.lib
17     )
18 else ()
19     list(APPEND WebKit_SOURCES_Classes
20         win/WebDownloadCFNet.cpp
21         win/WebURLAuthenticationChallengeSenderCFNet.cpp
22     )
23     list(APPEND WebKit_LIBRARIES
24         PRIVATE CFNetwork${DEBUG_SUFFIX}
25         PRIVATE CoreFoundation${DEBUG_SUFFIX}
26         PRIVATE CoreGraphics${DEBUG_SUFFIX}
27         PRIVATE CoreText${DEBUG_SUFFIX}
28         PRIVATE QuartzCore${DEBUG_SUFFIX}
29         PRIVATE SQLite3${DEBUG_SUFFIX}
30         PRIVATE WebKitSystemInterface${DEBUG_SUFFIX}
31         PRIVATE libdispatch${DEBUG_SUFFIX}
32         PRIVATE libicuin${DEBUG_SUFFIX}
33         PRIVATE libicuuc${DEBUG_SUFFIX}
34         PRIVATE libxml2${DEBUG_SUFFIX}
35         PRIVATE libxslt${DEBUG_SUFFIX}
36         PRIVATE zdll${DEBUG_SUFFIX}
37     )
38 endif ()
39
40 list(APPEND WebKit_LIBRARIES PRIVATE WTF${DEBUG_SUFFIX})
41
42 add_custom_command(
43     OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/WebKitVersion.h
44     MAIN_DEPENDENCY ${WEBKIT_DIR}/scripts/generate-webkitversion.pl
45     DEPENDS ${WEBKIT_DIR}/mac/Configurations/Version.xcconfig
46     COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/scripts/generate-webkitversion.pl --config ${WEBKIT_DIR}/mac/Configurations/Version.xcconfig --outputDir ${DERIVED_SOURCES_WEBKIT_DIR}
47     VERBATIM)
48 list(APPEND WebKit_SOURCES ${DERIVED_SOURCES_WEBKIT_DIR}/WebKitVersion.h)
49
50 list(APPEND WebKit_INCLUDE_DIRECTORIES
51     "${CMAKE_BINARY_DIR}/../include/private"
52     "${CMAKE_BINARY_DIR}/../include/private/JavaScriptCore"
53     "${CMAKE_BINARY_DIR}/../include/private/WebCore"
54     "${WEBKIT_DIR}/win"
55     "${WEBKIT_DIR}/win/plugins"
56     "${WEBKIT_DIR}/win/WebCoreSupport"
57     "${DERIVED_SOURCES_WEBKIT_DIR}/include"
58     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces"
59     "${FORWARDING_HEADERS_DIR}/ANGLE"
60     "${FORWARDING_HEADERS_DIR}/ANGLE/include"
61     "${FORWARDING_HEADERS_DIR}/ANGLE/include/egl"
62     "${FORWARDING_HEADERS_DIR}/ANGLE/include/khr"
63     "${DERIVED_SOURCES_DIR}/WebKit"
64 )
65
66 list(APPEND WebKit_INCLUDES
67     win/CFDictionaryPropertyBag.h
68     win/COMEnumVariant.h
69     win/COMPropertyBag.h
70     win/COMVariantSetter.h
71     win/CodeAnalysisConfig.h
72     win/DOMCSSClasses.h
73     win/DOMCoreClasses.h
74     win/DOMEventsClasses.h
75     win/DOMHTMLClasses.h
76     win/DefaultDownloadDelegate.h
77     win/DefaultPolicyDelegate.h
78     win/ForEachCoClass.h
79     win/FullscreenVideoController.h
80     win/MarshallingHelpers.h
81     win/MemoryStream.h
82     win/ProgIDMacros.h
83     win/WebActionPropertyBag.h
84     win/WebApplicationCache.h
85     win/WebArchive.h
86     win/WebBackForwardList.h
87     win/WebCache.h
88     win/WebCachedFramePlatformData.h
89     win/WebCoreStatistics.h
90     win/WebDataSource.h
91     win/WebDatabaseManager.h
92     win/WebDocumentLoader.h
93     win/WebDownload.h
94     win/WebDropSource.h
95     win/WebElementPropertyBag.h
96     win/WebError.h
97     win/WebFrame.h
98     win/WebFramePolicyListener.h
99     win/WebGeolocationPolicyListener.h
100     win/WebGeolocationPosition.h
101     win/WebHTMLRepresentation.h
102     win/WebHistory.h
103     win/WebHistoryItem.h
104     win/WebIconDatabase.h
105     win/WebJavaScriptCollector.h
106     win/WebKitCOMAPI.h
107     win/WebKitClassFactory.h
108     win/WebKitDLL.h
109     win/WebKitGraphics.h
110     win/WebKitLogging.h
111     win/WebKitStatistics.h
112     win/WebKitStatisticsPrivate.h
113     win/WebKitSystemBits.h
114     win/WebLocalizableStrings.h
115     win/WebMutableURLRequest.h
116     win/WebNavigationData.h
117     win/WebNotification.h
118     win/WebNotificationCenter.h
119     win/WebPreferenceKeysPrivate.h
120     win/WebPreferences.h
121     win/WebResource.h
122     win/WebScriptObject.h
123     win/WebScriptWorld.h
124     win/WebSecurityOrigin.h
125     win/WebSerializedJSValue.h
126     win/WebTextRenderer.h
127     win/WebURLAuthenticationChallenge.h
128     win/WebURLAuthenticationChallengeSender.h
129     win/WebURLCredential.h
130     win/WebURLProtectionSpace.h
131     win/WebURLResponse.h
132     win/WebUserContentURLPattern.h
133     win/WebView.h
134     win/WebWorkersPrivate.h
135 )
136
137 list(APPEND WebKit_SOURCES_Classes
138     cf/WebCoreSupport/WebInspectorClientCF.cpp
139
140     win/AccessibleBase.cpp
141     win/AccessibleDocument.cpp
142     win/AccessibleImage.cpp
143     win/AccessibleTextImpl.cpp
144     win/BackForwardList.cpp
145     win/CFDictionaryPropertyBag.cpp
146     win/DOMCSSClasses.cpp
147     win/DOMCoreClasses.cpp
148     win/DOMEventsClasses.cpp
149     win/DOMHTMLClasses.cpp
150     win/DefaultDownloadDelegate.cpp
151     win/DefaultPolicyDelegate.cpp
152     win/ForEachCoClass.cpp
153     win/FullscreenVideoController.cpp
154     win/MarshallingHelpers.cpp
155     win/MemoryStream.cpp
156     win/WebActionPropertyBag.cpp
157     win/WebApplicationCache.cpp
158     win/WebArchive.cpp
159     win/WebBackForwardList.cpp
160     win/WebCache.cpp
161     win/WebCoreStatistics.cpp
162     win/WebDataSource.cpp
163     win/WebDatabaseManager.cpp
164     win/WebDocumentLoader.cpp
165     win/WebDownload.cpp
166     win/WebDropSource.cpp
167     win/WebElementPropertyBag.cpp
168     win/WebError.cpp
169     win/WebFrame.cpp
170     win/WebFramePolicyListener.cpp
171     win/WebGeolocationPolicyListener.cpp
172     win/WebGeolocationPosition.cpp
173     win/WebHTMLRepresentation.cpp
174     win/WebHistory.cpp
175     win/WebHistoryItem.cpp
176     win/WebIconDatabase.cpp
177     win/WebInspector.cpp
178     win/WebJavaScriptCollector.cpp
179     win/WebKitCOMAPI.cpp
180     win/WebKitClassFactory.cpp
181     win/WebKitDLL.cpp
182     win/WebKitLogging.cpp
183     win/WebKitMessageLoop.cpp
184     win/WebKitStatistics.cpp
185     win/WebKitSystemBits.cpp
186     win/WebLocalizableStrings.cpp
187     win/WebMutableURLRequest.cpp
188     win/WebNavigationData.cpp
189     win/WebNodeHighlight.cpp
190     win/WebNotification.cpp
191     win/WebNotificationCenter.cpp
192     win/WebPreferences.cpp
193     win/WebResource.cpp
194     win/WebScriptObject.cpp
195     win/WebScriptWorld.cpp
196     win/WebSecurityOrigin.cpp
197     win/WebSerializedJSValue.cpp
198     win/WebTextRenderer.cpp
199     win/WebURLAuthenticationChallenge.cpp
200     win/WebURLAuthenticationChallengeSender.cpp
201     win/WebURLCredential.cpp
202     win/WebURLProtectionSpace.cpp
203     win/WebURLResponse.cpp
204     win/WebUserContentURLPattern.cpp
205     win/WebView.cpp
206     win/WebWorkersPrivate.cpp
207
208     win/plugins/PluginDatabase.cpp
209     win/plugins/PluginDatabaseWin.cpp
210     win/plugins/PluginDebug.cpp
211     win/plugins/PluginMainThreadScheduler.cpp
212     win/plugins/PluginMessageThrottlerWin.cpp
213     win/plugins/PluginPackage.cpp
214     win/plugins/PluginPackageWin.cpp
215     win/plugins/PluginStream.cpp
216     win/plugins/PluginView.cpp
217     win/plugins/PluginViewWin.cpp
218     win/plugins/npapi.cpp
219
220     win/storage/WebDatabaseProvider.cpp
221 )
222
223 list(APPEND WebKit_SOURCES_WebCoreSupport
224     win/WebCoreSupport/AcceleratedCompositingContext.cpp
225     win/WebCoreSupport/EmbeddedWidget.cpp
226     win/WebCoreSupport/EmbeddedWidget.h
227     win/WebCoreSupport/WebChromeClient.cpp
228     win/WebCoreSupport/WebChromeClient.h
229     win/WebCoreSupport/WebContextMenuClient.cpp
230     win/WebCoreSupport/WebContextMenuClient.h
231     win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp
232     win/WebCoreSupport/WebDesktopNotificationsDelegate.h
233     win/WebCoreSupport/WebDragClient.cpp
234     win/WebCoreSupport/WebDragClient.h
235     win/WebCoreSupport/WebEditorClient.cpp
236     win/WebCoreSupport/WebEditorClient.h
237     win/WebCoreSupport/WebFrameLoaderClient.cpp
238     win/WebCoreSupport/WebFrameLoaderClient.h
239     win/WebCoreSupport/WebFrameNetworkingContext.cpp
240     win/WebCoreSupport/WebFrameNetworkingContext.h
241     win/WebCoreSupport/WebGeolocationClient.cpp
242     win/WebCoreSupport/WebGeolocationClient.h
243     win/WebCoreSupport/WebInspectorClient.cpp
244     win/WebCoreSupport/WebInspectorClient.h
245     win/WebCoreSupport/WebInspectorDelegate.cpp
246     win/WebCoreSupport/WebInspectorDelegate.h
247     win/WebCoreSupport/WebPlatformStrategies.cpp
248     win/WebCoreSupport/WebPlatformStrategies.h
249     win/WebCoreSupport/WebPluginInfoProvider.cpp
250     win/WebCoreSupport/WebPluginInfoProvider.h
251     win/WebCoreSupport/WebVisitedLinkStore.cpp
252     win/WebCoreSupport/WebVisitedLinkStore.h
253 )
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/IWebIconDatabase.idl
341     win/Interfaces/IWebInspector.idl
342     win/Interfaces/IWebInspectorPrivate.idl
343     win/Interfaces/IWebJavaScriptCollector.idl
344     win/Interfaces/IWebKitStatistics.idl
345     win/Interfaces/IWebMutableURLRequest.idl
346     win/Interfaces/IWebMutableURLRequestPrivate.idl
347     win/Interfaces/IWebNavigationData.idl
348     win/Interfaces/IWebNotification.idl
349     win/Interfaces/IWebNotificationCenter.idl
350     win/Interfaces/IWebNotificationObserver.idl
351     win/Interfaces/IWebPolicyDelegate.idl
352     win/Interfaces/IWebPolicyDelegatePrivate.idl
353     win/Interfaces/IWebPreferences.idl
354     win/Interfaces/IWebPreferencesPrivate.idl
355     win/Interfaces/IWebResource.idl
356     win/Interfaces/IWebResourceLoadDelegate.idl
357     win/Interfaces/IWebResourceLoadDelegatePrivate.idl
358     win/Interfaces/IWebResourceLoadDelegatePrivate2.idl
359     win/Interfaces/IWebScriptObject.idl
360     win/Interfaces/IWebScriptWorld.idl
361     win/Interfaces/IWebSecurityOrigin.idl
362     win/Interfaces/IWebSerializedJSValue.idl
363     win/Interfaces/IWebSerializedJSValuePrivate.idl
364     win/Interfaces/IWebTextRenderer.idl
365     win/Interfaces/IWebUIDelegate.idl
366     win/Interfaces/IWebUIDelegate2.idl
367     win/Interfaces/IWebUIDelegatePrivate.idl
368     win/Interfaces/IWebURLAuthenticationChallenge.idl
369     win/Interfaces/IWebURLRequest.idl
370     win/Interfaces/IWebURLResponse.idl
371     win/Interfaces/IWebURLResponsePrivate.idl
372     win/Interfaces/IWebUndoManager.idl
373     win/Interfaces/IWebUndoTarget.idl
374     win/Interfaces/IWebUserContentURLPattern.idl
375     win/Interfaces/IWebView.idl
376     win/Interfaces/IWebViewPrivate.idl
377     win/Interfaces/IWebWorkersPrivate.idl
378     win/Interfaces/JavaScriptCoreAPITypes.idl
379     win/Interfaces/WebKit.idl
380     win/Interfaces/WebScrollbarTypes.idl
381
382     win/Interfaces/Accessible2/Accessible2.idl
383     win/Interfaces/Accessible2/Accessible2_2.idl
384     win/Interfaces/Accessible2/AccessibleApplication.idl
385     win/Interfaces/Accessible2/AccessibleEditableText.idl
386     win/Interfaces/Accessible2/AccessibleRelation.idl
387     win/Interfaces/Accessible2/AccessibleStates.idl
388     win/Interfaces/Accessible2/AccessibleText.idl
389     win/Interfaces/Accessible2/AccessibleText2.idl
390     win/Interfaces/Accessible2/IA2CommonTypes.idl
391     "${DERIVED_SOURCES_WEBKIT_DIR}/include/autoversion.h"
392 )
393
394 add_custom_command(
395     OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/include/autoversion.h
396     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
397     COMMAND ${PERL_EXECUTABLE} ${WEBKIT_LIBRARIES_DIR}/tools/scripts/auto-version.pl ${DERIVED_SOURCES_WEBKIT_DIR}
398     VERBATIM)
399
400 GENERATE_INTERFACE(win/Interfaces/WebKit.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
401 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleApplication.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
402 GENERATE_INTERFACE(win/Interfaces/Accessible2/Accessible2.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
403 GENERATE_INTERFACE(win/Interfaces/Accessible2/Accessible2_2.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
404 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleRelation.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
405 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleStates.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
406 GENERATE_INTERFACE(win/Interfaces/Accessible2/IA2CommonTypes.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
407 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleEditableText.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
408 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleText.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
409 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleText2.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
410
411 add_library(WebKitGUID STATIC
412     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/WebKit.h"
413     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleApplication.h"
414     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/Accessible2.h"
415     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/Accessible2_2.h"
416     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleRelation.h"
417     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleStates.h"
418     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/IA2CommonTypes.h"
419     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleEditableText.h"
420     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleText.h"
421     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleText2.h"
422     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/WebKit_i.c"
423     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleApplication_i.c"
424     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/Accessible2_i.c"
425     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/Accessible2_2_i.c"
426     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleRelation_i.c"
427     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleEditableText_i.c"
428     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleText_i.c"
429     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleText2_i.c"
430 )
431 set_target_properties(WebKitGUID PROPERTIES OUTPUT_NAME WebKitGUID${DEBUG_SUFFIX})
432
433 list(APPEND WebKit_LIBRARIES
434     PRIVATE Comctl32
435     PRIVATE Comsupp
436     PRIVATE Crypt32
437     PRIVATE D2d1
438     PRIVATE Dwrite
439     PRIVATE dxguid
440     PRIVATE Iphlpapi
441     PRIVATE Psapi
442     PRIVATE Rpcrt4
443     PRIVATE Shlwapi
444     PRIVATE Usp10
445     PRIVATE Version
446     PRIVATE Winmm
447     PRIVATE WebKitGUID${DEBUG_SUFFIX}
448     PRIVATE WebCoreDerivedSources${DEBUG_SUFFIX}
449     PRIVATE WindowsCodecs
450 )
451
452 if (ENABLE_GRAPHICS_CONTEXT_3D)
453     list(APPEND WebKit_LIBRARIES
454         libANGLE${DEBUG_SUFFIX}
455         libEGL${DEBUG_SUFFIX}
456         libGLESv2${DEBUG_SUFFIX}
457     )
458 endif ()
459
460 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
461 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
462
463 # We need the webkit libraries to come before the system default libraries to prevent symbol conflicts with uuid.lib.
464 # To do this we add system default libs as webkit libs and zero out system default libs.
465 string(REPLACE " " "\;" CXX_LIBS ${CMAKE_CXX_STANDARD_LIBRARIES})
466 list(APPEND WebKit_LIBRARIES ${CXX_LIBS})
467 set(CMAKE_CXX_STANDARD_LIBRARIES "")
468
469 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:MSVCRT /NODEFAULTLIB:MSVCRTD")
470
471 # If this directory isn't created before midl runs and attempts to output WebKit.tlb,
472 # It fails with an unusual error - midl failed - failed to save all changes
473 file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
474 file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces)
475
476 set(WebKitGUID_PRE_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/WebKit/preBuild.cmd")
477 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")
478 file(MAKE_DIRECTORY ${FORWARDING_HEADERS_DIR}/WebKit)
479 add_custom_command(TARGET WebKitGUID PRE_BUILD COMMAND ${WebKitGUID_PRE_BUILD_COMMAND} VERBATIM)
480
481 set(WebKitGUID_POST_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/WebKit/postBuild.cmd")
482 file(WRITE "${WebKitGUID_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/*.h\" \"${FORWARDING_HEADERS_DIR}/WebKit\" >nul 2>nul")
483 add_custom_command(TARGET WebKitGUID POST_BUILD COMMAND ${WebKitGUID_POST_BUILD_COMMAND} VERBATIM)
484
485 set(WebKit_OUTPUT_NAME
486     WebKit${DEBUG_SUFFIX}
487 )