daa5b3546ad1edf5223058dbc925e59a76d6da0e
[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     "${DERIVED_SOURCES_PAL_DIR}"
40 )
41
42 list(APPEND WebCore_SOURCES
43     accessibility/win/AXObjectCacheWin.cpp
44     accessibility/win/AccessibilityObjectWin.cpp
45     accessibility/win/AccessibilityObjectWrapperWin.cpp
46
47     editing/SmartReplaceCF.cpp
48     editing/win/EditorWin.cpp
49
50     html/HTMLSelectElementWin.cpp
51
52     page/win/DragControllerWin.cpp
53     page/win/EventHandlerWin.cpp
54     page/win/FrameWin.cpp
55
56     platform/Cursor.cpp
57     platform/LocalizedStrings.cpp
58     platform/StaticPasteboard.cpp
59
60     platform/audio/PlatformMediaSessionManager.cpp
61
62     platform/graphics/GraphicsContext3DPrivate.cpp
63
64     platform/graphics/egl/GLContextEGL.cpp
65
66     platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
67     platform/graphics/opengl/Extensions3DOpenGLES.cpp
68     platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
69     platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp
70     platform/graphics/opengl/TemporaryOpenGLSetting.cpp
71
72     platform/graphics/opentype/OpenTypeUtilities.cpp
73
74     platform/graphics/win/ColorDirect2D.cpp
75     platform/graphics/win/ComplexTextControllerDirectWrite.cpp
76     platform/graphics/win/DIBPixelData.cpp
77     platform/graphics/win/FloatPointDirect2D.cpp
78     platform/graphics/win/FloatRectDirect2D.cpp
79     platform/graphics/win/FloatSizeDirect2D.cpp
80     platform/graphics/win/FontCacheWin.cpp
81     platform/graphics/win/FontPlatformDataWin.cpp
82     platform/graphics/win/FontWin.cpp
83     platform/graphics/win/FullScreenController.cpp
84     platform/graphics/win/GraphicsContextWin.cpp
85     platform/graphics/win/IconWin.cpp
86     platform/graphics/win/ImageWin.cpp
87     platform/graphics/win/IntPointWin.cpp
88     platform/graphics/win/IntRectWin.cpp
89     platform/graphics/win/IntSizeWin.cpp
90     platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp
91     platform/graphics/win/SimpleFontDataWin.cpp
92     platform/graphics/win/TransformationMatrixDirect2D.cpp
93     platform/graphics/win/TransformationMatrixWin.cpp
94     platform/graphics/win/UniscribeController.cpp
95
96     platform/network/win/DownloadBundleWin.cpp
97     platform/network/win/NetworkStateNotifierWin.cpp
98
99     platform/text/LocaleNone.cpp
100
101     platform/win/BString.cpp
102     platform/win/BitmapInfo.cpp
103     platform/win/ClipboardUtilitiesWin.cpp
104     platform/win/CursorWin.cpp
105     platform/win/DefWndProcWindowClass.cpp
106     platform/win/DragDataWin.cpp
107     platform/win/DragImageWin.cpp
108     platform/win/EventLoopWin.cpp
109     platform/win/FileSystemWin.cpp
110     platform/win/GDIObjectCounter.cpp
111     platform/win/GDIUtilities.cpp
112     platform/win/KeyEventWin.cpp
113     platform/win/LocalizedStringsWin.cpp
114     platform/win/LoggingWin.cpp
115     platform/win/MIMETypeRegistryWin.cpp
116     platform/win/MainThreadSharedTimerWin.cpp
117     platform/win/PasteboardWin.cpp
118     platform/win/PathWalker.cpp
119     platform/win/PlatformMouseEventWin.cpp
120     platform/win/PlatformScreenWin.cpp
121     platform/win/PopupMenuWin.cpp
122     platform/win/SSLKeyGeneratorWin.cpp
123     platform/win/ScrollbarThemeWin.cpp
124     platform/win/SearchPopupMenuWin.cpp
125     platform/win/SharedBufferWin.cpp
126     platform/win/StructuredExceptionHandlerSuppressor.cpp
127     platform/win/SystemInfo.cpp
128     platform/win/WCDataObject.cpp
129     platform/win/WebCoreBundleWin.cpp
130     platform/win/WebCoreInstanceHandle.cpp
131     platform/win/WebCoreTextRenderer.cpp
132     platform/win/WheelEventWin.cpp
133     platform/win/WidgetWin.cpp
134     platform/win/WindowMessageBroadcaster.cpp
135
136     rendering/RenderThemeWin.cpp
137 )
138
139 list(APPEND WebCore_USER_AGENT_STYLE_SHEETS
140     ${WEBCORE_DIR}/css/themeWin.css
141     ${WEBCORE_DIR}/css/themeWinQuirks.css
142 )
143
144 set(WebCore_FORWARDING_HEADERS_DIRECTORIES
145     .
146     accessibility
147     animation
148     bindings
149     bridge
150     contentextensions
151     css
152     dom
153     editing
154     fileapi
155     history
156     html
157     inspector
158     loader
159     page
160     platform
161     plugins
162     rendering
163     storage
164     style
165     svg
166     websockets
167     workers
168     xml
169
170     Modules/cache
171     Modules/fetch
172     Modules/geolocation
173     Modules/indexeddb
174     Modules/mediastream
175     Modules/websockets
176
177     Modules/indexeddb/client
178     Modules/indexeddb/legacy
179     Modules/indexeddb/server
180     Modules/indexeddb/shared
181     Modules/notifications
182     Modules/webdatabase
183
184     accessibility/win
185
186     bindings/js
187
188     bridge/c
189     bridge/jsc
190
191     css/parser
192
193     html/forms
194     html/parser
195     html/shadow
196     html/track
197
198     loader/appcache
199     loader/archive
200     loader/cache
201     loader/icon
202
203
204     page/animation
205     page/csp
206     page/scrolling
207     page/win
208
209     platform/animation
210     platform/audio
211     platform/graphics
212     platform/mock
213     platform/network
214     platform/sql
215     platform/text
216     platform/win
217
218     platform/graphics/filters
219     platform/graphics/opengl
220     platform/graphics/opentype
221     platform/graphics/texmap
222     platform/graphics/transforms
223     platform/graphics/win
224
225     platform/mediastream/libwebrtc
226
227     platform/text/transcoder
228
229     rendering/line
230     rendering/shapes
231     rendering/style
232     rendering/svg
233
234     svg/animation
235     svg/graphics
236     svg/properties
237
238     svg/graphics/filters
239
240     workers/service
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 make_directory(${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/WebKit.resources/en.lproj)
291 file(COPY
292     "${WEBCORE_DIR}/English.lproj/Localizable.strings"
293     "${WEBCORE_DIR}/English.lproj/mediaControlsLocalizedStrings.js"
294     DESTINATION
295     ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/WebKit.resources/en.lproj
296 )
297 file(COPY
298     "${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsApple.css"
299     "${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsApple.js"
300     DESTINATION
301     ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/WebKit.resources
302 )
303 if (WTF_PLATFORM_WIN_CAIRO AND EXISTS ${WEBKIT_LIBRARIES_DIR}/etc/ssl/cert.pem)
304     make_directory(${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/WebKit.resources/certificates)
305     file(COPY
306         ${WEBKIT_LIBRARIES_DIR}/etc/ssl/cert.pem
307         DESTINATION
308         ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/WebKit.resources/certificates
309     )
310     file(RENAME
311         ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/WebKit.resources/certificates/cert.pem
312         ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/WebKit.resources/certificates/cacert.pem
313     )
314 endif ()
315
316 file(MAKE_DIRECTORY ${FORWARDING_HEADERS_DIR}/WebCore)
317
318 set(WebCore_DERIVED_SOURCES_PRE_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/WebCore/preBuild.cmd")
319 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")
320 foreach (_directory ${WebCore_FORWARDING_HEADERS_DIRECTORIES})
321     file(APPEND "${WebCore_DERIVED_SOURCES_PRE_BUILD_COMMAND}" "@xcopy /y /d /f \"${WEBCORE_DIR}/${_directory}/*.h\" \"${FORWARDING_HEADERS_DIR}/WebCore\" >nul 2>nul\n")
322 endforeach ()
323
324 set(WebCore_POST_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/WebCore/postBuild.cmd")
325 file(WRITE "${WebCore_POST_BUILD_COMMAND}" "@xcopy /y /s /d /f \"${DERIVED_SOURCES_WEBCORE_DIR}/*.h\" \"${FORWARDING_HEADERS_DIR}/WebCore\" >nul 2>nul\n")
326 file(APPEND "${WebCore_POST_BUILD_COMMAND}" "@xcopy /y /s /d /f \"${DERIVED_SOURCES_PAL_DIR}/*.h\" \"${FORWARDING_HEADERS_DIR}/WebCore\" >nul 2>nul\n")
327
328 set(WebCore_OUTPUT_NAME
329     WebCore${DEBUG_SUFFIX}
330 )
331
332 list(APPEND WebCore_LIBRARIES WTF${DEBUG_SUFFIX})
333 if (TARGET libEGL)
334     list(APPEND WebCore_LIBRARIES libEGL)
335 endif ()
336 list(APPEND WebCoreTestSupport_LIBRARIES WTF${DEBUG_SUFFIX})