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