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