Progress towards building AppleWin with CMake
[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         "$ENV{WEBKIT_LIBRARIES}/include"
5         "$ENV{WEBKIT_LIBRARIES}/include/cairo"
6         "$ENV{WEBKIT_LIBRARIES}/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         libeay32.lib
15         ssleay32.lib
16     )
17 endif ()
18
19 list(APPEND WebKit_INCLUDE_DIRECTORIES
20     Storage
21     win
22     win/plugins
23     win/WebCoreSupport
24     WebCoreSupport
25     WebKit.vcxproj/WebKit
26     "${DERIVED_SOURCES_WEBKIT_DIR}/include"
27     "${CMAKE_SOURCE_DIR}/Source"
28     "${DERIVED_SOURCES_WEBKIT_DIR}/include/WebCore"
29     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
30     "${DERIVED_SOURCES_WEBCORE_DIR}"
31     "${DERIVED_SOURCES_DIR}"
32     "${JAVASCRIPTCORE_DIR}/dfg"
33     "${WEBCORE_DIR}/style"
34     "${WEBCORE_DIR}/loader/archive"
35     "${WEBCORE_DIR}/loader/archive/cf"
36     "${WEBCORE_DIR}/page/scrolling"
37     "${WEBCORE_DIR}/platform/cf"
38     "${WEBCORE_DIR}/platform/graphics/win"
39     "${WEBCORE_DIR}/platform/graphics/filters"
40     "${WEBCORE_DIR}/platform/audio"
41     "${WEBCORE_DIR}/platform/win"
42     "${WEBCORE_DIR}/rendering/line"
43     "${WEBCORE_DIR}/html/shadow"
44     "${WEBCORE_DIR}/modules/websockets"
45     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces"
46     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector"
47 )
48
49 list(APPEND WebKit_INCLUDES
50     win/CFDictionaryPropertyBag.h
51     win/COMEnumVariant.h
52     win/COMPropertyBag.h
53     win/COMVariantSetter.h
54     win/CodeAnalysisConfig.h
55     win/DOMCSSClasses.h
56     win/DOMCoreClasses.h
57     win/DOMEventsClasses.h
58     win/DOMHTMLClasses.h
59     win/DefaultDownloadDelegate.h
60     win/DefaultPolicyDelegate.h
61     win/ForEachCoClass.h
62     win/FullscreenVideoController.h
63     win/MarshallingHelpers.h
64     win/MemoryStream.h
65     win/ProgIDMacros.h
66     win/WebActionPropertyBag.h
67     win/WebArchive.h
68     win/WebBackForwardList.h
69     win/WebCache.h
70     win/WebCachedFramePlatformData.h
71     win/WebCoreStatistics.h
72     win/WebDataSource.h
73     win/WebDatabaseManager.h
74     win/WebDocumentLoader.h
75     win/WebDownload.h
76     win/WebDropSource.h
77     win/WebElementPropertyBag.h
78     win/WebError.h
79     win/WebFrame.h
80     win/WebFramePolicyListener.h
81     win/WebGeolocationPolicyListener.h
82     win/WebGeolocationPosition.h
83     win/WebHTMLRepresentation.h
84     win/WebHistory.h
85     win/WebHistoryItem.h
86     win/WebIconDatabase.h
87     win/WebJavaScriptCollector.h
88     win/WebKitCOMAPI.h
89     win/WebKitClassFactory.h
90     win/WebKitDLL.h
91     win/WebKitGraphics.h
92     win/WebKitLogging.h
93     win/WebKitStatistics.h
94     win/WebKitStatisticsPrivate.h
95     win/WebKitSystemBits.h
96     win/WebLocalizableStrings.h
97     win/WebMutableURLRequest.h
98     win/WebNavigationData.h
99     win/WebNotification.h
100     win/WebNotificationCenter.h
101     win/WebPreferenceKeysPrivate.h
102     win/WebPreferences.h
103     win/WebResource.h
104     win/WebScriptObject.h
105     win/WebScriptWorld.h
106     win/WebSecurityOrigin.h
107     win/WebSerializedJSValue.h
108     win/WebTextRenderer.h
109     win/WebURLAuthenticationChallenge.h
110     win/WebURLAuthenticationChallengeSender.h
111     win/WebURLCredential.h
112     win/WebURLProtectionSpace.h
113     win/WebURLResponse.h
114     win/WebUserContentURLPattern.h
115     win/WebView.h
116     win/WebWorkersPrivate.h
117 )
118
119 list(APPEND WebKit_SOURCES_Classes
120     Storage/StorageAreaImpl.cpp
121     Storage/StorageAreaSync.cpp
122     Storage/StorageNamespaceImpl.cpp
123     Storage/StorageSyncManager.cpp
124     Storage/StorageThread.cpp
125     Storage/StorageTracker.cpp
126     Storage/WebDatabaseProvider.cpp
127     Storage/WebStorageNamespaceProvider.cpp
128
129     cf/WebCoreSupport/WebInspectorClientCF.cpp
130
131     win/AccessibleBase.cpp
132     win/AccessibleDocument.cpp
133     win/AccessibleImage.cpp
134     win/AccessibleTextImpl.cpp
135     win/CFDictionaryPropertyBag.cpp
136     win/DOMCSSClasses.cpp
137     win/DOMCoreClasses.cpp
138     win/DOMEventsClasses.cpp
139     win/DOMHTMLClasses.cpp
140     win/DefaultDownloadDelegate.cpp
141     win/DefaultPolicyDelegate.cpp
142     win/ForEachCoClass.cpp
143     win/FullscreenVideoController.cpp
144     win/MarshallingHelpers.cpp
145     win/MemoryStream.cpp
146     win/WebActionPropertyBag.cpp
147     win/WebArchive.cpp
148     win/WebBackForwardList.cpp
149     win/WebCache.cpp
150     win/WebCoreStatistics.cpp
151     win/WebDataSource.cpp
152     win/WebDatabaseManager.cpp
153     win/WebDocumentLoader.cpp
154     win/WebDownload.cpp
155     win/WebDropSource.cpp
156     win/WebElementPropertyBag.cpp
157     win/WebError.cpp
158     win/WebFrame.cpp
159     win/WebFramePolicyListener.cpp
160     win/WebGeolocationPolicyListener.cpp
161     win/WebGeolocationPosition.cpp
162     win/WebHTMLRepresentation.cpp
163     win/WebHistory.cpp
164     win/WebHistoryItem.cpp
165     win/WebIconDatabase.cpp
166     win/WebInspector.cpp
167     win/WebJavaScriptCollector.cpp
168     win/WebKitCOMAPI.cpp
169     win/WebKitClassFactory.cpp
170     win/WebKitDLL.cpp
171     win/WebKitLogging.cpp
172     win/WebKitMessageLoop.cpp
173     win/WebKitStatistics.cpp
174     win/WebKitSystemBits.cpp
175     win/WebLocalizableStrings.cpp
176     win/WebMutableURLRequest.cpp
177     win/WebNavigationData.cpp
178     win/WebNodeHighlight.cpp
179     win/WebNotification.cpp
180     win/WebNotificationCenter.cpp
181     win/WebPreferences.cpp
182     win/WebResource.cpp
183     win/WebScriptObject.cpp
184     win/WebScriptWorld.cpp
185     win/WebSecurityOrigin.cpp
186     win/WebSerializedJSValue.cpp
187     win/WebTextRenderer.cpp
188     win/WebURLAuthenticationChallenge.cpp
189     win/WebURLAuthenticationChallengeSender.cpp
190     win/WebURLCredential.cpp
191     win/WebURLProtectionSpace.cpp
192     win/WebURLResponse.cpp
193     win/WebUserContentURLPattern.cpp
194     win/WebView.cpp
195     win/WebWorkersPrivate.cpp
196
197     win/plugins/PluginDatabase.cpp
198     win/plugins/PluginDatabaseWin.cpp
199     win/plugins/PluginDebug.cpp
200     win/plugins/PluginMainThreadScheduler.cpp
201     win/plugins/PluginMessageThrottlerWin.cpp
202     win/plugins/PluginPackage.cpp
203     win/plugins/PluginPackageWin.cpp
204     win/plugins/PluginStream.cpp
205     win/plugins/PluginView.cpp
206     win/plugins/PluginViewWin.cpp
207     win/plugins/npapi.cpp
208 )
209
210 list(APPEND WebKit_SOURCES_WebCoreSupport
211     WebCoreSupport/WebViewGroup.cpp
212     WebCoreSupport/WebViewGroup.h
213
214     win/WebCoreSupport/EmbeddedWidget.cpp
215     win/WebCoreSupport/EmbeddedWidget.h
216     win/WebCoreSupport/WebChromeClient.cpp
217     win/WebCoreSupport/WebChromeClient.h
218     win/WebCoreSupport/WebContextMenuClient.cpp
219     win/WebCoreSupport/WebContextMenuClient.h
220     win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp
221     win/WebCoreSupport/WebDesktopNotificationsDelegate.h
222     win/WebCoreSupport/WebDragClient.cpp
223     win/WebCoreSupport/WebDragClient.h
224     win/WebCoreSupport/WebEditorClient.cpp
225     win/WebCoreSupport/WebEditorClient.h
226     win/WebCoreSupport/WebFrameLoaderClient.cpp
227     win/WebCoreSupport/WebFrameLoaderClient.h
228     win/WebCoreSupport/WebFrameNetworkingContext.cpp
229     win/WebCoreSupport/WebFrameNetworkingContext.h
230     win/WebCoreSupport/WebGeolocationClient.cpp
231     win/WebCoreSupport/WebGeolocationClient.h
232     win/WebCoreSupport/WebInspectorClient.cpp
233     win/WebCoreSupport/WebInspectorClient.h
234     win/WebCoreSupport/WebInspectorDelegate.cpp
235     win/WebCoreSupport/WebInspectorDelegate.h
236     win/WebCoreSupport/WebPlatformStrategies.cpp
237     win/WebCoreSupport/WebPlatformStrategies.h
238     win/WebCoreSupport/WebVisitedLinkStore.cpp
239     win/WebCoreSupport/WebVisitedLinkStore.h
240 )
241
242 list(APPEND WebKit_SOURCES ${WebKit_INCLUDES} ${WebKit_SOURCES_Classes} ${WebKit_SOURCES_WebCoreSupport})
243
244 source_group(Includes FILES ${WebKit_INCLUDES})
245 source_group(Classes FILES ${WebKit_SOURCES_Classes})
246 source_group(WebCoreSupport FILES ${WebKit_SOURCES_WebCoreSupport})
247
248 # Build the COM interface:
249 macro(GENERATE_INTERFACE _infile _defines _depends)
250     get_filename_component(_filewe ${_infile} NAME_WE)
251     add_custom_command(
252         OUTPUT  ${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/${_filewe}.h
253         MAIN_DEPENDENCY ${_infile}
254         DEPENDS ${_depends}
255         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}"
256         VERBATIM)
257     set_source_files_properties(${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/${_filewe}.h PROPERTIES GENERATED TRUE)
258     set_source_files_properties(${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/${_filewe}_i.c PROPERTIES GENERATED TRUE)
259 endmacro()
260
261 set(MIDL_DEFINES /D\ \"__PRODUCTION__=01\")
262
263 set(WEBKIT_IDL_DEPENDENCIES
264     win/Interfaces/AccessibleComparable.idl
265     win/Interfaces/DOMCSS.idl
266     win/Interfaces/DOMCore.idl
267     win/Interfaces/DOMEvents.idl
268     win/Interfaces/DOMExtensions.idl
269     win/Interfaces/DOMHTML.idl
270     win/Interfaces/DOMPrivate.idl
271     win/Interfaces/DOMRange.idl
272     win/Interfaces/DOMWindow.idl
273     win/Interfaces/IGEN_DOMObject.idl
274     win/Interfaces/IWebArchive.idl
275     win/Interfaces/IWebBackForwardList.idl
276     win/Interfaces/IWebBackForwardListPrivate.idl
277     win/Interfaces/IWebCache.idl
278     win/Interfaces/IWebCoreStatistics.idl
279     win/Interfaces/IWebDataSource.idl
280     win/Interfaces/IWebDatabaseManager.idl
281     win/Interfaces/IWebDesktopNotificationsDelegate.idl
282     win/Interfaces/IWebDocument.idl
283     win/Interfaces/IWebDownload.idl
284     win/Interfaces/IWebEditingDelegate.idl
285     win/Interfaces/IWebEmbeddedView.idl
286     win/Interfaces/IWebError.idl
287     win/Interfaces/IWebErrorPrivate.idl
288     win/Interfaces/IWebFormDelegate.idl
289     win/Interfaces/IWebFrame.idl
290     win/Interfaces/IWebFrameLoadDelegate.idl
291     win/Interfaces/IWebFrameLoadDelegatePrivate.idl
292     win/Interfaces/IWebFrameLoadDelegatePrivate2.idl
293     win/Interfaces/IWebFramePrivate.idl
294     win/Interfaces/IWebFrameView.idl
295     win/Interfaces/IWebGeolocationPolicyListener.idl
296     win/Interfaces/IWebGeolocationPosition.idl
297     win/Interfaces/IWebGeolocationProvider.idl
298     win/Interfaces/IWebHTMLRepresentation.idl
299     win/Interfaces/IWebHTTPURLResponse.idl
300     win/Interfaces/IWebHistory.idl
301     win/Interfaces/IWebHistoryDelegate.idl
302     win/Interfaces/IWebHistoryItem.idl
303     win/Interfaces/IWebHistoryItemPrivate.idl
304     win/Interfaces/IWebHistoryPrivate.idl
305     win/Interfaces/IWebIconDatabase.idl
306     win/Interfaces/IWebInspector.idl
307     win/Interfaces/IWebInspectorPrivate.idl
308     win/Interfaces/IWebJavaScriptCollector.idl
309     win/Interfaces/IWebKitStatistics.idl
310     win/Interfaces/IWebMutableURLRequest.idl
311     win/Interfaces/IWebMutableURLRequestPrivate.idl
312     win/Interfaces/IWebNavigationData.idl
313     win/Interfaces/IWebNotification.idl
314     win/Interfaces/IWebNotificationCenter.idl
315     win/Interfaces/IWebNotificationObserver.idl
316     win/Interfaces/IWebPolicyDelegate.idl
317     win/Interfaces/IWebPolicyDelegatePrivate.idl
318     win/Interfaces/IWebPreferences.idl
319     win/Interfaces/IWebPreferencesPrivate.idl
320     win/Interfaces/IWebResource.idl
321     win/Interfaces/IWebResourceLoadDelegate.idl
322     win/Interfaces/IWebResourceLoadDelegatePrivate.idl
323     win/Interfaces/IWebResourceLoadDelegatePrivate2.idl
324     win/Interfaces/IWebScriptObject.idl
325     win/Interfaces/IWebScriptWorld.idl
326     win/Interfaces/IWebSecurityOrigin.idl
327     win/Interfaces/IWebSerializedJSValue.idl
328     win/Interfaces/IWebSerializedJSValuePrivate.idl
329     win/Interfaces/IWebTextRenderer.idl
330     win/Interfaces/IWebUIDelegate.idl
331     win/Interfaces/IWebUIDelegate2.idl
332     win/Interfaces/IWebUIDelegatePrivate.idl
333     win/Interfaces/IWebURLAuthenticationChallenge.idl
334     win/Interfaces/IWebURLRequest.idl
335     win/Interfaces/IWebURLResponse.idl
336     win/Interfaces/IWebURLResponsePrivate.idl
337     win/Interfaces/IWebUndoManager.idl
338     win/Interfaces/IWebUndoTarget.idl
339     win/Interfaces/IWebUserContentURLPattern.idl
340     win/Interfaces/IWebView.idl
341     win/Interfaces/IWebViewPrivate.idl
342     win/Interfaces/IWebWorkersPrivate.idl
343     win/Interfaces/JavaScriptCoreAPITypes.idl
344     win/Interfaces/WebKit.idl
345     win/Interfaces/WebScrollbarTypes.idl
346
347     win/Interfaces/Accessible2/Accessible2.idl
348     win/Interfaces/Accessible2/Accessible2_2.idl
349     win/Interfaces/Accessible2/AccessibleApplication.idl
350     win/Interfaces/Accessible2/AccessibleEditableText.idl
351     win/Interfaces/Accessible2/AccessibleRelation.idl
352     win/Interfaces/Accessible2/AccessibleStates.idl
353     win/Interfaces/Accessible2/AccessibleText.idl
354     win/Interfaces/Accessible2/AccessibleText2.idl
355     win/Interfaces/Accessible2/IA2CommonTypes.idl
356     "${DERIVED_SOURCES_WEBKIT_DIR}/autoversion.h"
357 )
358
359 add_custom_command(
360     OUTPUT ${DERIVED_SOURCES_WEBKIT_DIR}/autoversion.h
361     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
362     COMMAND ${PERL_EXECUTABLE} ${CMAKE_SOURCE_DIR}/WebKitLibraries/win/tools/scripts/auto-version.pl ${DERIVED_SOURCES_WEBKIT_DIR}
363     VERBATIM)
364
365 GENERATE_INTERFACE(win/Interfaces/WebKit.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
366 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleApplication.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
367 GENERATE_INTERFACE(win/Interfaces/Accessible2/Accessible2.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
368 GENERATE_INTERFACE(win/Interfaces/Accessible2/Accessible2_2.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
369 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleRelation.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
370 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleStates.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
371 GENERATE_INTERFACE(win/Interfaces/Accessible2/IA2CommonTypes.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
372 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleEditableText.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
373 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleText.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
374 GENERATE_INTERFACE(win/Interfaces/Accessible2/AccessibleText2.idl ${MIDL_DEFINES} "${WEBKIT_IDL_DEPENDENCIES}")
375
376 add_library(WebKitGUID STATIC
377     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/WebKit.h"
378     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleApplication.h"
379     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/Accessible2.h"
380     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/Accessible2_2.h"
381     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleRelation.h"
382     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleStates.h"
383     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/IA2CommonTypes.h"
384     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleEditableText.h"
385     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleText.h"
386     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleText2.h"
387     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/WebKit_i.c"
388     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleApplication_i.c"
389     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/Accessible2_i.c"
390     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/Accessible2_2_i.c"
391     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleRelation_i.c"
392     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleEditableText_i.c"
393     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleText_i.c"
394     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/AccessibleText2_i.c"
395 )
396 set_target_properties(WebKitGUID PROPERTIES FOLDER "WebKit")
397
398 list(APPEND WebKit_LIBRARIES
399     WebKitGUID
400     comsupp.lib
401 )
402
403 # We need the webkit libraries to come before the system default libraries to prevent symbol conflicts with uuid.lib.
404 # To do this we add system default libs as webkit libs and zero out system default libs.
405 string(REPLACE " " "\;" CXX_LIBS ${CMAKE_CXX_STANDARD_LIBRARIES})
406 list(APPEND WebKit_LIBRARIES ${CXX_LIBS})
407 set(CMAKE_CXX_STANDARD_LIBRARIES "")
408
409 # If this directory isn't created before midl runs and attempts to output WebKit.tlb,
410 # It fails with an unusual error - midl failed - failed to save all changes
411 file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
412 file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces)
413
414 set(WebKit_FORWARDING_HEADERS
415     "${DERIVED_SOURCES_WEBKIT_DIR}/Interfaces/WebKit.h"
416     "${CMAKE_CURRENT_SOURCE_DIR}/win/WebKitCOMAPI.h"
417     "win/CFDictionaryPropertyBag.h"
418 )
419
420 WEBKIT_CREATE_FORWARDING_HEADERS(WebKit FILES ${WebKit_FORWARDING_HEADERS})