[cmake] Include WTF, JSC, and WebCore headers automatically to targers using them
[WebKit-https.git] / Source / WebCore / PlatformGTK.cmake
1 include(platform/GStreamer.cmake)
2 include(platform/ImageDecoders.cmake)
3 include(platform/Linux.cmake)
4
5 if (USE_TEXTURE_MAPPER)
6     include(platform/TextureMapper.cmake)
7 endif ()
8
9 set(WebCore_OUTPUT_NAME WebCoreGTK)
10
11 list(APPEND WebCore_INCLUDE_DIRECTORIES
12     "${THIRDPARTY_DIR}/ANGLE/"
13     "${THIRDPARTY_DIR}/ANGLE/include/KHR"
14     "${WEBCORE_DIR}/accessibility/atk"
15     "${WEBCORE_DIR}/editing/atk"
16     "${WEBCORE_DIR}/page/gtk"
17     "${WEBCORE_DIR}/platform/cairo"
18     "${WEBCORE_DIR}/platform/gamepad"
19     "${WEBCORE_DIR}/platform/gamepad/deprecated"
20     "${WEBCORE_DIR}/platform/gamepad/glib"
21     "${WEBCORE_DIR}/platform/geoclue"
22     "${WEBCORE_DIR}/platform/gtk"
23     "${WEBCORE_DIR}/platform/graphics/cairo"
24     "${WEBCORE_DIR}/platform/graphics/egl"
25     "${WEBCORE_DIR}/platform/graphics/glx"
26     "${WEBCORE_DIR}/platform/graphics/gtk"
27     "${WEBCORE_DIR}/platform/graphics/freetype"
28     "${WEBCORE_DIR}/platform/graphics/harfbuzz/"
29     "${WEBCORE_DIR}/platform/graphics/harfbuzz/ng"
30     "${WEBCORE_DIR}/platform/graphics/opengl"
31     "${WEBCORE_DIR}/platform/graphics/opentype"
32     "${WEBCORE_DIR}/platform/graphics/wayland"
33     "${WEBCORE_DIR}/platform/graphics/x11"
34     "${WEBCORE_DIR}/platform/mediastream/gtk"
35     "${WEBCORE_DIR}/platform/mock/mediasource"
36     "${WEBCORE_DIR}/platform/network/gtk"
37     "${WEBCORE_DIR}/platform/network/soup"
38     "${WEBCORE_DIR}/platform/text/gtk"
39 )
40
41 list(APPEND WebCore_SOURCES
42     accessibility/atk/AXObjectCacheAtk.cpp
43     accessibility/atk/AccessibilityObjectAtk.cpp
44     accessibility/atk/WebKitAccessibleHyperlink.cpp
45     accessibility/atk/WebKitAccessibleInterfaceAction.cpp
46     accessibility/atk/WebKitAccessibleInterfaceComponent.cpp
47     accessibility/atk/WebKitAccessibleInterfaceDocument.cpp
48     accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp
49     accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp
50     accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp
51     accessibility/atk/WebKitAccessibleInterfaceImage.cpp
52     accessibility/atk/WebKitAccessibleInterfaceSelection.cpp
53     accessibility/atk/WebKitAccessibleInterfaceTable.cpp
54     accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp
55     accessibility/atk/WebKitAccessibleInterfaceText.cpp
56     accessibility/atk/WebKitAccessibleInterfaceValue.cpp
57     accessibility/atk/WebKitAccessibleUtil.cpp
58     accessibility/atk/WebKitAccessibleWrapperAtk.cpp
59
60     editing/atk/FrameSelectionAtk.cpp
61
62     loader/soup/CachedRawResourceSoup.cpp
63     loader/soup/SubresourceLoaderSoup.cpp
64
65     platform/KillRingNone.cpp
66     platform/StaticPasteboard.cpp
67     platform/UserAgentQuirks.cpp
68
69     platform/audio/glib/AudioBusGLib.cpp
70
71     platform/crypto/gcrypt/CryptoDigestGCrypt.cpp
72
73     platform/gamepad/glib/GamepadsGlib.cpp
74
75     platform/geoclue/GeolocationProviderGeoclue1.cpp
76     platform/geoclue/GeolocationProviderGeoclue2.cpp
77
78     platform/glib/EventLoopGlib.cpp
79     platform/glib/FileSystemGlib.cpp
80     platform/glib/KeyedDecoderGlib.cpp
81     platform/glib/KeyedEncoderGlib.cpp
82     platform/glib/MainThreadSharedTimerGLib.cpp
83     platform/glib/SharedBufferGlib.cpp
84
85     platform/graphics/GLContext.cpp
86     platform/graphics/GraphicsContext3DPrivate.cpp
87
88     platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp
89     platform/graphics/cairo/BackingStoreBackendCairoX11.cpp
90     platform/graphics/cairo/CairoUtilities.cpp
91     platform/graphics/cairo/FloatRectCairo.cpp
92     platform/graphics/cairo/FontCairo.cpp
93     platform/graphics/cairo/FontCairoHarfbuzzNG.cpp
94     platform/graphics/cairo/GradientCairo.cpp
95     platform/graphics/cairo/GraphicsContext3DCairo.cpp
96     platform/graphics/cairo/GraphicsContextCairo.cpp
97     platform/graphics/cairo/ImageBufferCairo.cpp
98     platform/graphics/cairo/ImageCairo.cpp
99     platform/graphics/cairo/IntRectCairo.cpp
100     platform/graphics/cairo/NativeImageCairo.cpp
101     platform/graphics/cairo/PathCairo.cpp
102     platform/graphics/cairo/PatternCairo.cpp
103     platform/graphics/cairo/PlatformContextCairo.cpp
104     platform/graphics/cairo/PlatformPathCairo.cpp
105     platform/graphics/cairo/RefPtrCairo.cpp
106     platform/graphics/cairo/TransformationMatrixCairo.cpp
107
108     platform/graphics/egl/GLContextEGL.cpp
109     platform/graphics/egl/GLContextEGLWayland.cpp
110     platform/graphics/egl/GLContextEGLX11.cpp
111
112     platform/graphics/freetype/FontCacheFreeType.cpp
113     platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp
114     platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp
115     platform/graphics/freetype/SimpleFontDataFreeType.cpp
116
117     platform/graphics/glx/GLContextGLX.cpp
118
119     platform/graphics/gstreamer/ImageGStreamerCairo.cpp
120
121     platform/graphics/harfbuzz/HarfBuzzFace.cpp
122     platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp
123     platform/graphics/harfbuzz/HarfBuzzShaper.cpp
124
125     platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
126     platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
127     platform/graphics/opengl/TemporaryOpenGLSetting.cpp
128
129     platform/graphics/opentype/OpenTypeVerticalData.cpp
130
131     platform/graphics/wayland/PlatformDisplayWayland.cpp
132
133     platform/graphics/x11/PlatformDisplayX11.cpp
134     platform/graphics/x11/XErrorTrapper.cpp
135     platform/graphics/x11/XUniqueResource.cpp
136
137     platform/gtk/DragDataGtk.cpp
138     platform/gtk/ErrorsGtk.cpp
139     platform/gtk/MIMETypeRegistryGtk.cpp
140     platform/gtk/PasteboardGtk.cpp
141     platform/gtk/ScrollAnimatorGtk.cpp
142     platform/gtk/SelectionData.cpp
143     platform/gtk/TemporaryLinkStubs.cpp
144     platform/gtk/UserAgentGtk.cpp
145
146     platform/image-decoders/cairo/ImageBackingStoreCairo.cpp
147
148     platform/network/soup/AuthenticationChallengeSoup.cpp
149     platform/network/soup/CertificateInfo.cpp
150     platform/network/soup/CookieJarSoup.cpp
151     platform/network/soup/CookieStorageSoup.cpp
152     platform/network/soup/CredentialStorageSoup.cpp
153     platform/network/soup/DNSSoup.cpp
154     platform/network/soup/GRefPtrSoup.cpp
155     platform/network/soup/NetworkStorageSessionSoup.cpp
156     platform/network/soup/ProxyServerSoup.cpp
157     platform/network/soup/ResourceErrorSoup.cpp
158     platform/network/soup/ResourceHandleSoup.cpp
159     platform/network/soup/ResourceRequestSoup.cpp
160     platform/network/soup/ResourceResponseSoup.cpp
161     platform/network/soup/SocketStreamHandleImplSoup.cpp
162     platform/network/soup/SoupNetworkSession.cpp
163     platform/network/soup/SynchronousLoaderClientSoup.cpp
164     platform/network/soup/WebKitSoupRequestGeneric.cpp
165
166     platform/soup/PublicSuffixSoup.cpp
167     platform/soup/SharedBufferSoup.cpp
168     platform/soup/URLSoup.cpp
169
170     platform/text/Hyphenation.cpp
171     platform/text/LocaleICU.cpp
172
173     platform/text/enchant/TextCheckerEnchant.cpp
174
175     platform/text/hyphen/HyphenationLibHyphen.cpp
176
177     platform/unix/LoggingUnix.cpp
178 )
179
180 list(APPEND WebCorePlatformGTK_SOURCES
181     editing/gtk/EditorGtk.cpp
182
183     page/gtk/DragControllerGtk.cpp
184     page/gtk/EventHandlerGtk.cpp
185
186     platform/graphics/PlatformDisplay.cpp
187
188     platform/graphics/freetype/FontPlatformDataFreeType.cpp
189
190     platform/graphics/gtk/ColorGtk.cpp
191     platform/graphics/gtk/GdkCairoUtilities.cpp
192     platform/graphics/gtk/IconGtk.cpp
193     platform/graphics/gtk/ImageBufferGtk.cpp
194     platform/graphics/gtk/ImageGtk.cpp
195
196     platform/gtk/CursorGtk.cpp
197     platform/gtk/DragImageGtk.cpp
198     platform/gtk/GRefPtrGtk.cpp
199     platform/gtk/GtkUtilities.cpp
200     platform/gtk/GtkVersioning.c
201     platform/gtk/LocalizedStringsGtk.cpp
202     platform/gtk/PasteboardHelper.cpp
203     platform/gtk/PlatformKeyboardEventGtk.cpp
204     platform/gtk/PlatformMouseEventGtk.cpp
205     platform/gtk/PlatformPasteboardGtk.cpp
206     platform/gtk/PlatformScreenGtk.cpp
207     platform/gtk/PlatformWheelEventGtk.cpp
208     platform/gtk/RenderThemeGadget.cpp
209     platform/gtk/ScrollbarThemeGtk.cpp
210     platform/gtk/SoundGtk.cpp
211     platform/gtk/WidgetGtk.cpp
212
213     rendering/RenderThemeGtk.cpp
214 )
215
216 if (USE_GEOCLUE2)
217     list(APPEND WebCore_DERIVED_SOURCES
218         ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c
219     )
220     execute_process(COMMAND pkg-config --variable dbus_interface geoclue-2.0 OUTPUT_VARIABLE GEOCLUE_DBUS_INTERFACE)
221     add_custom_command(
222          OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.h
223          COMMAND gdbus-codegen --interface-prefix org.freedesktop.GeoClue2. --c-namespace Geoclue --generate-c-code ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface ${GEOCLUE_DBUS_INTERFACE}
224     )
225     set_source_files_properties(${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
226 endif ()
227
228 list(APPEND WebCore_USER_AGENT_STYLE_SHEETS
229     ${WEBCORE_DIR}/css/mediaControlsGtk.css
230 )
231
232 set(WebCore_USER_AGENT_SCRIPTS
233     ${WEBCORE_DIR}/English.lproj/mediaControlsLocalizedStrings.js
234     ${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsBase.js
235     ${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsGtk.js
236 )
237
238 set(WebCore_USER_AGENT_SCRIPTS_DEPENDENCIES ${WEBCORE_DIR}/platform/gtk/RenderThemeGtk.cpp)
239
240 list(APPEND WebCore_LIBRARIES
241     ${ATK_LIBRARIES}
242     ${CAIRO_LIBRARIES}
243     ${ENCHANT_LIBRARIES}
244     ${FONTCONFIG_LIBRARIES}
245     ${FREETYPE2_LIBRARIES}
246     ${GEOCLUE_LIBRARIES}
247     ${GLIB_GIO_LIBRARIES}
248     ${GLIB_GMODULE_LIBRARIES}
249     ${GLIB_GOBJECT_LIBRARIES}
250     ${GLIB_LIBRARIES}
251     ${GUDEV_LIBRARIES}
252     ${HARFBUZZ_LIBRARIES}
253     ${LIBGCRYPT_LIBRARIES}
254     ${LIBSECRET_LIBRARIES}
255     ${LIBSOUP_LIBRARIES}
256     ${LIBXML2_LIBRARIES}
257     ${LIBXSLT_LIBRARIES}
258     ${HYPHEN_LIBRARIES}
259     ${SQLITE_LIBRARIES}
260     ${X11_X11_LIB}
261     ${X11_Xcomposite_LIB}
262     ${X11_Xdamage_LIB}
263     ${X11_Xrender_LIB}
264     ${X11_Xt_LIB}
265     ${ZLIB_LIBRARIES}
266     WTF
267 )
268
269 list(APPEND WebCoreTestSupport_LIBRARIES WTF)
270
271 list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
272     ${ATK_INCLUDE_DIRS}
273     ${CAIRO_INCLUDE_DIRS}
274     ${ENCHANT_INCLUDE_DIRS}
275     ${FREETYPE2_INCLUDE_DIRS}
276     ${GEOCLUE_INCLUDE_DIRS}
277     ${GIO_UNIX_INCLUDE_DIRS}
278     ${GLIB_INCLUDE_DIRS}
279     ${GUDEV_INCLUDE_DIRS}
280     ${HARFBUZZ_INCLUDE_DIRS}
281     ${LIBGCRYPT_INCLUDE_DIRS}
282     ${LIBSECRET_INCLUDE_DIRS}
283     ${LIBSOUP_INCLUDE_DIRS}
284     ${LIBXML2_INCLUDE_DIR}
285     ${LIBXSLT_INCLUDE_DIR}
286     ${SQLITE_INCLUDE_DIR}
287     ${ZLIB_INCLUDE_DIRS}
288 )
289
290 if (USE_OPENGL_ES_2)
291     list(APPEND WebCore_SOURCES
292         platform/graphics/opengl/Extensions3DOpenGLES.cpp
293         platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp
294     )
295 endif ()
296
297 if (USE_OPENGL)
298     list(APPEND WebCore_SOURCES
299         platform/graphics/OpenGLShims.cpp
300
301         platform/graphics/opengl/Extensions3DOpenGL.cpp
302         platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
303     )
304 endif ()
305
306 if (ENABLE_PLUGIN_PROCESS_GTK2)
307     # WebKitPluginProcess2 needs a version of WebCore compiled against GTK+2, so we've isolated all the GTK+
308     # dependent files into a separate library which can be used to construct a GTK+2 WebCore
309     # for the plugin process.
310     add_library(WebCorePlatformGTK2 ${WebCore_LIBRARY_TYPE} ${WebCorePlatformGTK_SOURCES})
311     add_dependencies(WebCorePlatformGTK2 WebCore)
312     WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebCorePlatformGTK2)
313     set_property(TARGET WebCorePlatformGTK2
314         APPEND
315         PROPERTY COMPILE_DEFINITIONS GTK_API_VERSION_2=1
316     )
317     target_include_directories(WebCorePlatformGTK2 PRIVATE
318         ${WebCore_INCLUDE_DIRECTORIES}
319         ${GTK2_INCLUDE_DIRS}
320         ${GDK2_INCLUDE_DIRS}
321     )
322     target_include_directories(WebCorePlatformGTK2 SYSTEM PRIVATE
323         ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
324     )
325     target_link_libraries(WebCorePlatformGTK2
326          ${WebCore_LIBRARIES}
327          ${GTK2_LIBRARIES}
328          ${GDK2_LIBRARIES}
329     )
330 endif ()
331
332 if (ENABLE_WAYLAND_TARGET)
333     list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
334         ${WAYLAND_INCLUDE_DIRS}
335     )
336     list(APPEND WebCore_LIBRARIES
337         ${WAYLAND_LIBRARIES}
338     )
339 endif ()
340
341 add_library(WebCorePlatformGTK ${WebCore_LIBRARY_TYPE} ${WebCorePlatformGTK_SOURCES})
342 add_dependencies(WebCorePlatformGTK WebCore)
343 WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebCorePlatformGTK)
344 target_include_directories(WebCorePlatformGTK PRIVATE
345     ${WebCore_INCLUDE_DIRECTORIES}
346 )
347 target_include_directories(WebCorePlatformGTK SYSTEM PRIVATE
348     ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
349     ${GTK_INCLUDE_DIRS}
350     ${GDK_INCLUDE_DIRS}
351 )
352 target_link_libraries(WebCorePlatformGTK
353     ${WebCore_LIBRARIES}
354     ${GTK_LIBRARIES}
355     ${GDK_LIBRARIES}
356 )
357
358 include_directories(
359     ${WebCore_INCLUDE_DIRECTORIES}
360     "${WEBCORE_DIR}/bindings/gobject/"
361 )
362
363 include_directories(SYSTEM
364     ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
365 )
366
367 add_definitions(-DBUILDING_WEBKIT)
368
369 if (ENABLE_SMOOTH_SCROLLING)
370     list(APPEND WebCore_SOURCES
371         platform/ScrollAnimationSmooth.cpp
372     )
373 endif ()
374
375 if (ENABLE_SUBTLE_CRYPTO)
376     list(APPEND WebCore_SOURCES
377         crypto/CryptoAlgorithm.cpp
378         crypto/CryptoAlgorithmRegistry.cpp
379         crypto/CryptoKey.cpp
380         crypto/SubtleCrypto.cpp
381         crypto/WebKitSubtleCrypto.cpp
382
383         crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
384         crypto/algorithms/CryptoAlgorithmAES_KW.cpp
385         crypto/algorithms/CryptoAlgorithmHMAC.cpp
386         crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
387         crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
388         crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
389         crypto/algorithms/CryptoAlgorithmSHA1.cpp
390         crypto/algorithms/CryptoAlgorithmSHA224.cpp
391         crypto/algorithms/CryptoAlgorithmSHA256.cpp
392         crypto/algorithms/CryptoAlgorithmSHA384.cpp
393         crypto/algorithms/CryptoAlgorithmSHA512.cpp
394
395         crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp
396
397         crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp
398         crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp
399         crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp
400         crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp
401         crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp
402         crypto/gnutls/CryptoAlgorithmRegistryGnuTLS.cpp
403         crypto/gnutls/CryptoKeyRSAGnuTLS.cpp
404         crypto/gnutls/SerializedCryptoKeyWrapGnuTLS.cpp
405
406         crypto/keys/CryptoKeyAES.cpp
407         crypto/keys/CryptoKeyDataOctetSequence.cpp
408         crypto/keys/CryptoKeyDataRSAComponents.cpp
409         crypto/keys/CryptoKeyHMAC.cpp
410         crypto/keys/CryptoKeyRSA.cpp
411         crypto/keys/CryptoKeySerializationRaw.cpp
412     )
413 endif ()