[Win] Add Modules/fetch to list of forwarding headers folders.
[WebKit-https.git] / Source / WebCore / PlatformWin.cmake
1 add_definitions(/bigobj -D__STDC_CONSTANT_MACROS)
2
3 list(APPEND WebCore_INCLUDE_DIRECTORIES
4     "${WEBCORE_DIR}/ForwardingHeaders"
5     "${CMAKE_BINARY_DIR}/../include/private"
6     "${CMAKE_BINARY_DIR}/../include/private/JavaScriptCore"
7     "${FORWARDING_HEADERS_DIR}/ANGLE"
8     "${FORWARDING_HEADERS_DIR}/ANGLE/include/KHR"
9     "${FORWARDING_HEADERS_DIR}/JavaScriptCore"
10     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/ForwardingHeaders"
11     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/API"
12     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/assembler"
13     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/builtins"
14     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/bytecode"
15     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/bytecompiler"
16     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/dfg"
17     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/disassembler"
18     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/domjit"
19     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/heap"
20     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/debugger"
21     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/interpreter"
22     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/jit"
23     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/llint"
24     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/parser"
25     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/profiler"
26     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/runtime"
27     "${FORWARDING_HEADERS_DIR}/JavaScriptCore/yarr"
28     "${FORWARDING_HEADERS_DIR}/WTF"
29     "${WEBCORE_DIR}/accessibility/win"
30     "${WEBCORE_DIR}/page/win"
31     "${WEBCORE_DIR}/platform/graphics/egl"
32     "${WEBCORE_DIR}/platform/graphics/opengl"
33     "${WEBCORE_DIR}/platform/graphics/opentype"
34     "${WEBCORE_DIR}/platform/graphics/win"
35     "${WEBCORE_DIR}/platform/network/win"
36     "${WEBCORE_DIR}/platform/win"
37     "${THIRDPARTY_DIR}/ANGLE/include"
38     "${THIRDPARTY_DIR}/ANGLE/include/egl"
39 )
40
41 list(APPEND WebCore_SOURCES
42     accessibility/win/AXObjectCacheWin.cpp
43     accessibility/win/AccessibilityObjectWin.cpp
44     accessibility/win/AccessibilityObjectWrapperWin.cpp
45
46     editing/SmartReplaceCF.cpp
47     editing/win/EditorWin.cpp
48
49     html/HTMLSelectElementWin.cpp
50
51     page/win/DragControllerWin.cpp
52     page/win/EventHandlerWin.cpp
53     page/win/FrameWin.cpp
54
55     platform/Cursor.cpp
56     platform/LocalizedStrings.cpp
57     platform/StaticPasteboard.cpp
58
59     platform/audio/PlatformMediaSessionManager.cpp
60
61     platform/graphics/GraphicsContext3DPrivate.cpp
62
63     platform/graphics/egl/GLContextEGL.cpp
64
65     platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
66     platform/graphics/opengl/Extensions3DOpenGLES.cpp
67     platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
68     platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp
69     platform/graphics/opengl/TemporaryOpenGLSetting.cpp
70
71     platform/graphics/opentype/OpenTypeUtilities.cpp
72
73     platform/graphics/win/ColorDirect2D.cpp
74     platform/graphics/win/ComplexTextControllerDirectWrite.cpp
75     platform/graphics/win/DIBPixelData.cpp
76     platform/graphics/win/FloatPointDirect2D.cpp
77     platform/graphics/win/FloatRectDirect2D.cpp
78     platform/graphics/win/FloatSizeDirect2D.cpp
79     platform/graphics/win/FontCacheWin.cpp
80     platform/graphics/win/FontPlatformDataWin.cpp
81     platform/graphics/win/FontWin.cpp
82     platform/graphics/win/FullScreenController.cpp
83     platform/graphics/win/GraphicsContextWin.cpp
84     platform/graphics/win/IconWin.cpp
85     platform/graphics/win/ImageWin.cpp
86     platform/graphics/win/IntPointWin.cpp
87     platform/graphics/win/IntRectWin.cpp
88     platform/graphics/win/IntSizeWin.cpp
89     platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp
90     platform/graphics/win/SimpleFontDataWin.cpp
91     platform/graphics/win/TransformationMatrixDirect2D.cpp
92     platform/graphics/win/TransformationMatrixWin.cpp
93     platform/graphics/win/UniscribeController.cpp
94
95     platform/network/win/DownloadBundleWin.cpp
96     platform/network/win/NetworkStateNotifierWin.cpp
97
98     platform/text/LocaleNone.cpp
99
100     platform/win/BString.cpp
101     platform/win/BitmapInfo.cpp
102     platform/win/ClipboardUtilitiesWin.cpp
103     platform/win/CursorWin.cpp
104     platform/win/DefWndProcWindowClass.cpp
105     platform/win/DragDataWin.cpp
106     platform/win/DragImageWin.cpp
107     platform/win/EventLoopWin.cpp
108     platform/win/FileSystemWin.cpp
109     platform/win/GDIObjectCounter.cpp
110     platform/win/GDIUtilities.cpp
111     platform/win/KeyEventWin.cpp
112     platform/win/LocalizedStringsWin.cpp
113     platform/win/LoggingWin.cpp
114     platform/win/MIMETypeRegistryWin.cpp
115     platform/win/MainThreadSharedTimerWin.cpp
116     platform/win/PasteboardWin.cpp
117     platform/win/PathWalker.cpp
118     platform/win/PlatformMouseEventWin.cpp
119     platform/win/PlatformScreenWin.cpp
120     platform/win/PopupMenuWin.cpp
121     platform/win/SSLKeyGeneratorWin.cpp
122     platform/win/ScrollbarThemeWin.cpp
123     platform/win/SearchPopupMenuWin.cpp
124     platform/win/SharedBufferWin.cpp
125     platform/win/StructuredExceptionHandlerSuppressor.cpp
126     platform/win/SystemInfo.cpp
127     platform/win/WCDataObject.cpp
128     platform/win/WebCoreBundleWin.cpp
129     platform/win/WebCoreInstanceHandle.cpp
130     platform/win/WebCoreTextRenderer.cpp
131     platform/win/WheelEventWin.cpp
132     platform/win/WidgetWin.cpp
133     platform/win/WindowMessageBroadcaster.cpp
134
135     rendering/RenderThemeWin.cpp
136 )
137
138 list(APPEND WebCore_USER_AGENT_STYLE_SHEETS
139     ${WEBCORE_DIR}/css/themeWin.css
140     ${WEBCORE_DIR}/css/themeWinQuirks.css
141 )
142
143 list(APPEND WebCore_DERIVED_SOURCES
144     "${DERIVED_SOURCES_WEBCORE_DIR}/WebCoreHeaderDetection.h"
145 )
146
147 set(WebCore_FORWARDING_HEADERS_DIRECTORIES
148     .
149     accessibility
150     bindings
151     bridge
152     contentextensions
153     css
154     dom
155     editing
156     fileapi
157     history
158     html
159     inspector
160     loader
161     page
162     platform
163     plugins
164     rendering
165     storage
166     style
167     svg
168     websockets
169     workers
170     xml
171
172     Modules/cache
173     Modules/fetch
174     Modules/geolocation
175     Modules/indexeddb
176     Modules/mediastream
177     Modules/websockets
178
179     Modules/indexeddb/client
180     Modules/indexeddb/legacy
181     Modules/indexeddb/server
182     Modules/indexeddb/shared
183     Modules/notifications
184     Modules/webdatabase
185
186     accessibility/win
187
188     bindings/js
189
190     bridge/c
191     bridge/jsc
192
193     css/parser
194
195     html/forms
196     html/parser
197     html/shadow
198     html/track
199
200     loader/appcache
201     loader/archive
202     loader/cache
203     loader/icon
204
205
206     page/animation
207     page/csp
208     page/scrolling
209     page/win
210
211     platform/animation
212     platform/audio
213     platform/graphics
214     platform/mock
215     platform/network
216     platform/sql
217     platform/text
218     platform/win
219
220     platform/graphics/filters
221     platform/graphics/opengl
222     platform/graphics/opentype
223     platform/graphics/texmap
224     platform/graphics/transforms
225     platform/graphics/win
226
227     platform/mediastream/libwebrtc
228
229     platform/text/transcoder
230
231     rendering/line
232     rendering/shapes
233     rendering/style
234     rendering/svg
235
236     svg/animation
237     svg/graphics
238     svg/properties
239
240     svg/graphics/filters
241 )
242
243 if (USE_CF)
244     list(APPEND WebCore_INCLUDE_DIRECTORIES
245         "${WEBCORE_DIR}/platform/cf"
246         "${WEBCORE_DIR}/platform/cf/win"
247     )
248
249     list(APPEND WebCore_SOURCES
250         loader/archive/cf/LegacyWebArchive.cpp
251
252         platform/cf/CFURLExtras.cpp
253         platform/cf/FileSystemCF.cpp
254         platform/cf/KeyedDecoderCF.cpp
255         platform/cf/KeyedEncoderCF.cpp
256         platform/cf/SharedBufferCF.cpp
257         platform/cf/URLCF.cpp
258
259         platform/cf/win/CertificateCFWin.cpp
260
261         platform/text/cf/HyphenationCF.cpp
262     )
263
264     list(APPEND WebCore_FORWARDING_HEADERS_DIRECTORIES
265         history/cf
266
267         loader/archive/cf
268
269         platform/cf
270
271         platform/cf/win
272     )
273 endif ()
274
275 if (CMAKE_SIZEOF_VOID_P EQUAL 4)
276     list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/makesafeseh.obj)
277     add_custom_command(
278         OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/makesafeseh.obj
279         DEPENDS ${WEBCORE_DIR}/platform/win/makesafeseh.asm
280         COMMAND ml /safeseh /c /Fo ${DERIVED_SOURCES_WEBCORE_DIR}/makesafeseh.obj ${WEBCORE_DIR}/platform/win/makesafeseh.asm
281         VERBATIM)
282 endif ()
283
284 if (${WTF_PLATFORM_WIN_CAIRO})
285     include(PlatformWinCairo.cmake)
286 else ()
287     include(PlatformAppleWin.cmake)
288 endif ()
289
290 add_custom_command(
291     OUTPUT "${DERIVED_SOURCES_WEBCORE_DIR}/WebCoreHeaderDetection.h"
292     WORKING_DIRECTORY "${DERIVED_SOURCES_WEBCORE_DIR}"
293     COMMAND ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/AVFoundationSupport.py ${WEBKIT_LIBRARIES_DIR} > WebCoreHeaderDetection.h
294     VERBATIM)
295
296 make_directory(${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/WebKit.resources/en.lproj)
297 file(COPY
298     "${WEBCORE_DIR}/English.lproj/Localizable.strings"
299     "${WEBCORE_DIR}/English.lproj/mediaControlsLocalizedStrings.js"
300     DESTINATION
301     ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/WebKit.resources/en.lproj
302 )
303 file(COPY
304     "${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsApple.css"
305     "${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsApple.js"
306     DESTINATION
307     ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/WebKit.resources
308 )
309 if (WTF_PLATFORM_WIN_CAIRO AND EXISTS ${WEBKIT_LIBRARIES_DIR}/cacert.pem)
310     make_directory(${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/WebKit.resources/certificates)
311     file(COPY
312         ${WEBKIT_LIBRARIES_DIR}/cacert.pem
313         DESTINATION
314         ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/WebKit.resources/certificates
315     )
316 endif ()
317
318 file(MAKE_DIRECTORY ${FORWARDING_HEADERS_DIR}/WebCore)
319
320 set(WebCore_DERIVED_SOURCES_PRE_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/WebCore/preBuild.cmd")
321 file(WRITE "${WebCore_DERIVED_SOURCES_PRE_BUILD_COMMAND}" "@xcopy /y /s /d /f \"${WEBCORE_DIR}/ForwardingHeaders/*.h\" \"${FORWARDING_HEADERS_DIR}/WebCore\" >nul 2>nul\n")
322 foreach (_directory ${WebCore_FORWARDING_HEADERS_DIRECTORIES})
323     file(APPEND "${WebCore_DERIVED_SOURCES_PRE_BUILD_COMMAND}" "@xcopy /y /d /f \"${WEBCORE_DIR}/${_directory}/*.h\" \"${FORWARDING_HEADERS_DIR}/WebCore\" >nul 2>nul\n")
324 endforeach ()
325
326 set(WebCore_POST_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/WebCore/postBuild.cmd")
327 file(WRITE "${WebCore_POST_BUILD_COMMAND}" "@xcopy /y /s /d /f \"${DERIVED_SOURCES_WEBCORE_DIR}/*.h\" \"${FORWARDING_HEADERS_DIR}/WebCore\" >nul 2>nul\n")
328
329 set(WebCore_OUTPUT_NAME
330     WebCore${DEBUG_SUFFIX}
331 )
332
333 list(APPEND WebCore_LIBRARIES WTF${DEBUG_SUFFIX})
334 if (TARGET libEGL)
335     list(APPEND WebCore_LIBRARIES libEGL)
336 endif ()
337 list(APPEND WebCoreTestSupport_LIBRARIES WTF${DEBUG_SUFFIX})