0183011736d43598512034c0e6ba01b9aafbeb32
[WebKit-https.git] / Source / WebCore / PlatformGTK.cmake
1 list(APPEND WebCore_INCLUDE_DIRECTORIES
2     "${WEBCORE_DIR}/accessibility/atk"
3     "${WEBCORE_DIR}/editing/atk"
4     "${WEBCORE_DIR}/page/gtk"
5     "${WEBCORE_DIR}/platform/cairo"
6     "${WEBCORE_DIR}/platform/geoclue"
7     "${WEBCORE_DIR}/platform/gtk"
8     "${WEBCORE_DIR}/platform/graphics/cairo"
9     "${WEBCORE_DIR}/platform/graphics/egl"
10     "${WEBCORE_DIR}/platform/graphics/glx"
11     "${WEBCORE_DIR}/platform/graphics/gtk"
12     "${WEBCORE_DIR}/platform/graphics/freetype"
13     "${WEBCORE_DIR}/platform/graphics/harfbuzz/"
14     "${WEBCORE_DIR}/platform/graphics/harfbuzz/ng"
15     "${WEBCORE_DIR}/platform/graphics/opengl"
16     "${WEBCORE_DIR}/platform/graphics/opentype"
17     "${WEBCORE_DIR}/platform/graphics/wayland"
18     "${WEBCORE_DIR}/platform/linux"
19     "${WEBCORE_DIR}/platform/mediastream/openwebrtc"
20     "${WEBCORE_DIR}/platform/mock/mediasource"
21     "${WEBCORE_DIR}/platform/network/gtk"
22     "${WEBCORE_DIR}/platform/network/soup"
23     "${WEBCORE_DIR}/platform/text/gtk"
24 )
25
26 list(APPEND WebCore_SOURCES
27     accessibility/atk/AXObjectCacheAtk.cpp
28     accessibility/atk/AccessibilityObjectAtk.cpp
29     accessibility/atk/WebKitAccessibleHyperlink.cpp
30     accessibility/atk/WebKitAccessibleInterfaceAction.cpp
31     accessibility/atk/WebKitAccessibleInterfaceComponent.cpp
32     accessibility/atk/WebKitAccessibleInterfaceDocument.cpp
33     accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp
34     accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp
35     accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp
36     accessibility/atk/WebKitAccessibleInterfaceImage.cpp
37     accessibility/atk/WebKitAccessibleInterfaceSelection.cpp
38     accessibility/atk/WebKitAccessibleInterfaceTable.cpp
39     accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp
40     accessibility/atk/WebKitAccessibleInterfaceText.cpp
41     accessibility/atk/WebKitAccessibleInterfaceValue.cpp
42     accessibility/atk/WebKitAccessibleUtil.cpp
43     accessibility/atk/WebKitAccessibleWrapperAtk.cpp
44
45     editing/atk/FrameSelectionAtk.cpp
46     editing/SmartReplace.cpp
47
48     loader/soup/CachedRawResourceSoup.cpp
49     loader/soup/SubresourceLoaderSoup.cpp
50
51     platform/PlatformStrategies.cpp
52
53     platform/audio/gtk/AudioBusGtk.cpp
54
55     platform/audio/gstreamer/AudioDestinationGStreamer.cpp
56     platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
57     platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp
58     platform/audio/gstreamer/FFTFrameGStreamer.cpp
59     platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
60
61     platform/geoclue/GeolocationProviderGeoclue1.cpp
62     platform/geoclue/GeolocationProviderGeoclue2.cpp
63
64     platform/graphics/GraphicsContext3DPrivate.cpp
65     platform/graphics/ImageSource.cpp
66     platform/graphics/WOFFFileFormat.cpp
67
68     platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp
69     platform/graphics/cairo/BackingStoreBackendCairoX11.cpp
70     platform/graphics/cairo/BitmapImageCairo.cpp
71     platform/graphics/cairo/CairoUtilities.cpp
72     platform/graphics/cairo/FloatRectCairo.cpp
73     platform/graphics/cairo/FontCairo.cpp
74     platform/graphics/cairo/FontCairoHarfbuzzNG.cpp
75     platform/graphics/cairo/GradientCairo.cpp
76     platform/graphics/cairo/GraphicsContext3DCairo.cpp
77     platform/graphics/cairo/GraphicsContextCairo.cpp
78     platform/graphics/cairo/ImageBufferCairo.cpp
79     platform/graphics/cairo/ImageCairo.cpp
80     platform/graphics/cairo/IntRectCairo.cpp
81     platform/graphics/cairo/PathCairo.cpp
82     platform/graphics/cairo/PatternCairo.cpp
83     platform/graphics/cairo/PlatformContextCairo.cpp
84     platform/graphics/cairo/PlatformPathCairo.cpp
85     platform/graphics/cairo/RefPtrCairo.cpp
86     platform/graphics/cairo/TransformationMatrixCairo.cpp
87
88     platform/graphics/freetype/FontCacheFreeType.cpp
89     platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp
90     platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp
91     platform/graphics/freetype/SimpleFontDataFreeType.cpp
92
93     platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp
94     platform/graphics/gstreamer/GRefPtrGStreamer.cpp
95     platform/graphics/gstreamer/GStreamerUtilities.cpp
96     platform/graphics/gstreamer/ImageGStreamerCairo.cpp
97     platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp
98     platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
99     platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
100     platform/graphics/gstreamer/MediaSourceGStreamer.cpp
101     platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp
102     platform/graphics/gstreamer/TextCombinerGStreamer.cpp
103     platform/graphics/gstreamer/TextSinkGStreamer.cpp
104     platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp
105     platform/graphics/gstreamer/VideoSinkGStreamer.cpp
106     platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp
107     platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp
108     platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
109
110     platform/graphics/harfbuzz/HarfBuzzFace.cpp
111     platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp
112     platform/graphics/harfbuzz/HarfBuzzShaper.cpp
113
114     platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
115     platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
116     platform/graphics/opengl/TemporaryOpenGLSetting.cpp
117
118     platform/graphics/opentype/OpenTypeVerticalData.cpp
119
120     platform/gtk/ErrorsGtk.cpp
121     platform/gtk/EventLoopGtk.cpp
122     platform/gtk/FileSystemGtk.cpp
123     platform/gtk/GamepadsGtk.cpp
124     platform/gtk/LanguageGtk.cpp
125     platform/gtk/LoggingGtk.cpp
126     platform/gtk/MIMETypeRegistryGtk.cpp
127     platform/gtk/SharedBufferGtk.cpp
128     platform/gtk/SharedTimerGtk.cpp
129     platform/gtk/TemporaryLinkStubs.cpp
130     platform/gtk/UserAgentGtk.cpp
131
132     platform/image-decoders/ImageDecoder.cpp
133
134     platform/image-decoders/cairo/ImageDecoderCairo.cpp
135
136     platform/image-decoders/gif/GIFImageDecoder.cpp
137     platform/image-decoders/gif/GIFImageReader.cpp
138
139     platform/image-decoders/ico/ICOImageDecoder.cpp
140
141     platform/image-decoders/jpeg/JPEGImageDecoder.cpp
142
143     platform/image-decoders/bmp/BMPImageDecoder.cpp
144     platform/image-decoders/bmp/BMPImageReader.cpp
145
146     platform/image-decoders/png/PNGImageDecoder.cpp
147
148     platform/image-decoders/webp/WEBPImageDecoder.cpp
149
150     platform/linux/GamepadDeviceLinux.cpp
151     platform/linux/MemoryPressureHandlerLinux.cpp
152
153     platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp
154     platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp
155
156     platform/network/soup/AuthenticationChallengeSoup.cpp
157     platform/network/soup/CertificateInfo.cpp
158     platform/network/soup/CookieJarSoup.cpp
159     platform/network/soup/CookieStorageSoup.cpp
160     platform/network/soup/CredentialStorageSoup.cpp
161     platform/network/soup/DNSSoup.cpp
162     platform/network/soup/GRefPtrSoup.cpp
163     platform/network/soup/NetworkStorageSessionSoup.cpp
164     platform/network/soup/ProxyServerSoup.cpp
165     platform/network/soup/ResourceErrorSoup.cpp
166     platform/network/soup/ResourceHandleSoup.cpp
167     platform/network/soup/ResourceRequestSoup.cpp
168     platform/network/soup/ResourceResponseSoup.cpp
169     platform/network/soup/SocketStreamHandleSoup.cpp
170     platform/network/soup/SoupNetworkSession.cpp
171     platform/network/soup/SynchronousLoaderClientSoup.cpp
172
173     platform/soup/SharedBufferSoup.cpp
174     platform/soup/URLSoup.cpp
175
176     platform/text/LocaleICU.cpp
177
178     platform/text/enchant/TextCheckerEnchant.cpp
179
180     platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp
181
182     platform/network/gtk/CredentialBackingStore.cpp
183 )
184
185 list(APPEND WebCorePlatformGTK_SOURCES
186     editing/gtk/EditorGtk.cpp
187
188     page/gtk/DragControllerGtk.cpp
189     page/gtk/EventHandlerGtk.cpp
190
191     platform/graphics/GLContext.cpp
192
193     platform/graphics/egl/GLContextEGL.cpp
194
195     platform/graphics/freetype/FontPlatformDataFreeType.cpp
196
197     platform/graphics/glx/GLContextGLX.cpp
198
199     platform/graphics/gtk/ColorGtk.cpp
200     platform/graphics/gtk/GdkCairoUtilities.cpp
201     platform/graphics/gtk/IconGtk.cpp
202     platform/graphics/gtk/ImageBufferGtk.cpp
203     platform/graphics/gtk/ImageGtk.cpp
204
205     platform/gtk/ContextMenuGtk.cpp
206     platform/gtk/ContextMenuItemGtk.cpp
207     platform/gtk/CursorGtk.cpp
208     platform/gtk/DataObjectGtk.cpp
209     platform/gtk/DragDataGtk.cpp
210     platform/gtk/DragImageGtk.cpp
211     platform/gtk/GRefPtrGtk.cpp
212     platform/gtk/GtkUtilities.cpp
213     platform/gtk/GtkVersioning.c
214     platform/gtk/KeyBindingTranslator.cpp
215     platform/gtk/LocalizedStringsGtk.cpp
216     platform/gtk/PasteboardGtk.cpp
217     platform/gtk/PasteboardHelper.cpp
218     platform/gtk/PlatformKeyboardEventGtk.cpp
219     platform/gtk/PlatformMouseEventGtk.cpp
220     platform/gtk/PlatformScreenGtk.cpp
221     platform/gtk/PlatformWheelEventGtk.cpp
222     platform/gtk/ScrollbarThemeGtk.cpp
223     platform/gtk/SoundGtk.cpp
224     platform/gtk/WidgetGtk.cpp
225
226     rendering/RenderThemeGtk.cpp
227 )
228
229 if (WTF_USE_GEOCLUE2)
230     list(APPEND WebCore_SOURCES
231         ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c
232     )
233     execute_process(COMMAND pkg-config --variable dbus_interface geoclue-2.0 OUTPUT_VARIABLE GEOCLUE_DBUS_INTERFACE)
234     add_custom_command(
235          OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.h
236          COMMAND gdbus-codegen --interface-prefix org.freedesktop.GeoClue2. --c-namespace Geoclue --generate-c-code ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface ${GEOCLUE_DBUS_INTERFACE}
237     )
238 endif ()
239
240 list(APPEND WebCore_USER_AGENT_STYLE_SHEETS
241     ${WEBCORE_DIR}/css/mediaControlsGtk.css
242 )
243
244 set(WebCore_USER_AGENT_SCRIPTS
245     ${WEBCORE_DIR}/English.lproj/mediaControlsLocalizedStrings.js
246     ${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsBase.js
247     ${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsGtk.js
248 )
249
250 set(WebCore_USER_AGENT_SCRIPTS_DEPENDENCIES ${WEBCORE_DIR}/platform/gtk/RenderThemeGtk.cpp)
251
252 list(APPEND WebCore_LIBRARIES
253     ${ATK_LIBRARIES}
254     ${CAIRO_LIBRARIES}
255     ${ENCHANT_LIBRARIES}
256     ${FONTCONFIG_LIBRARIES}
257     ${FREETYPE2_LIBRARIES}
258     ${GEOCLUE_LIBRARIES}
259     ${GLIB_GIO_LIBRARIES}
260     ${GLIB_GMODULE_LIBRARIES}
261     ${GLIB_GOBJECT_LIBRARIES}
262     ${GLIB_LIBRARIES}
263     ${GUDEV_LIBRARIES}
264     ${HARFBUZZ_LIBRARIES}
265     ${JPEG_LIBRARIES}
266     ${LIBSECRET_LIBRARIES}
267     ${LIBSOUP_LIBRARIES}
268     ${LIBXML2_LIBRARIES}
269     ${LIBXSLT_LIBRARIES}
270     ${PNG_LIBRARIES}
271     ${SQLITE_LIBRARIES}
272     ${WEBP_LIBRARIES}
273     ${X11_X11_LIB}
274     ${X11_Xcomposite_LIB}
275     ${X11_Xdamage_LIB}
276     ${X11_Xrender_LIB}
277     ${X11_Xt_LIB}
278     ${ZLIB_LIBRARIES}
279 )
280
281 list(APPEND WebCore_INCLUDE_DIRECTORIES
282     ${ATK_INCLUDE_DIRS}
283     ${CAIRO_INCLUDE_DIRS}
284     ${ENCHANT_INCLUDE_DIRS}
285     ${FREETYPE2_INCLUDE_DIRS}
286     ${GEOCLUE_INCLUDE_DIRS}
287     ${GIO_UNIX_INCLUDE_DIRS}
288     ${GLIB_INCLUDE_DIRS}
289     ${GUDEV_INCLUDE_DIRS}
290     ${HARFBUZZ_INCLUDE_DIRS}
291     ${LIBSECRET_INCLUDE_DIRS}
292     ${LIBSOUP_INCLUDE_DIRS}
293     ${LIBXML2_INCLUDE_DIR}
294     ${LIBXSLT_INCLUDE_DIR}
295     ${SQLITE_INCLUDE_DIR}
296     ${WEBP_INCLUDE_DIRS}
297     ${ZLIB_INCLUDE_DIRS}
298 )
299
300 if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
301     list(APPEND WebCore_INCLUDE_DIRECTORIES
302         ${WEBCORE_DIR}/platform/graphics/gstreamer
303         ${GSTREAMER_INCLUDE_DIRS}
304         ${GSTREAMER_BASE_INCLUDE_DIRS}
305         ${GSTREAMER_APP_INCLUDE_DIRS}
306         ${GSTREAMER_PBUTILS_INCLUDE_DIRS}
307     )
308
309     list(APPEND WebCore_LIBRARIES
310         ${GSTREAMER_APP_LIBRARIES}
311         ${GSTREAMER_BASE_LIBRARIES}
312         ${GSTREAMER_LIBRARIES}
313         ${GSTREAMER_PBUTILS_LIBRARIES}
314         ${GSTREAMER_AUDIO_LIBRARIES}
315     )
316     # Avoiding a GLib deprecation warning due to GStreamer API using deprecated classes.
317     set_source_files_properties(platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp PROPERTIES COMPILE_DEFINITIONS "GLIB_DISABLE_DEPRECATION_WARNINGS=1")
318 endif ()
319
320 if (ENABLE_VIDEO)
321     list(APPEND WebCore_INCLUDE_DIRECTORIES
322         ${GSTREAMER_TAG_INCLUDE_DIRS}
323         ${GSTREAMER_VIDEO_INCLUDE_DIRS}
324     )
325     list(APPEND WebCore_LIBRARIES
326         ${GSTREAMER_TAG_LIBRARIES}
327         ${GSTREAMER_VIDEO_LIBRARIES}
328     )
329
330     if (USE_GSTREAMER_MPEGTS)
331         list(APPEND WebCore_INCLUDE_DIRECTORIES
332             ${GSTREAMER_MPEGTS_INCLUDE_DIRS}
333         )
334
335         list(APPEND WebCore_LIBRARIES
336             ${GSTREAMER_MPEGTS_LIBRARIES}
337         )
338     endif ()
339
340     if (USE_GSTREAMER_GL)
341         list(APPEND WebCore_INCLUDE_DIRECTORIES
342             ${GSTREAMER_GL_INCLUDE_DIRS}
343         )
344
345         list(APPEND WebCore_LIBRARIES
346             ${GSTREAMER_GL_LIBRARIES}
347         )
348     endif ()
349 endif ()
350
351 if (ENABLE_WEB_AUDIO)
352     list(APPEND WebCore_INCLUDE_DIRECTORIES
353         ${WEBCORE_DIR}/platform/audio/gstreamer
354         ${GSTREAMER_AUDIO_INCLUDE_DIRS}
355         ${GSTREAMER_FFT_INCLUDE_DIRS}
356     )
357     list(APPEND WebCore_LIBRARIES
358         ${GSTREAMER_FFT_LIBRARIES}
359     )
360 endif ()
361
362 if (ENABLE_MEDIA_STREAM)
363     list(APPEND WebCore_INCLUDE_DIRECTORIES
364         ${OPENWEBRTC_INCLUDE_DIRS}
365     )
366     list(APPEND WebCore_LIBRARIES
367         ${OPENWEBRTC_LIBRARIES}
368     )
369 endif ()
370
371 if (ENABLE_TEXTURE_MAPPER)
372     list(APPEND WebCore_INCLUDE_DIRECTORIES
373         "${WEBCORE_DIR}/platform/graphics/texmap"
374     )
375     list(APPEND WebCore_SOURCES
376         platform/graphics/texmap/BitmapTexture.cpp
377         platform/graphics/texmap/BitmapTextureGL.cpp
378         platform/graphics/texmap/BitmapTextureImageBuffer.cpp
379         platform/graphics/texmap/BitmapTexturePool.cpp
380         platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
381         platform/graphics/texmap/TextureMapperGL.cpp
382         platform/graphics/texmap/TextureMapperImageBuffer.cpp
383         platform/graphics/texmap/TextureMapperShaderProgram.cpp
384     )
385 endif ()
386
387 if (ENABLE_THREADED_COMPOSITOR)
388     list(APPEND WebCore_INCLUDE_DIRECTORIES
389         "${WEBCORE_DIR}/page/scrolling/coordinatedgraphics"
390         "${WEBCORE_DIR}/platform/graphics/texmap/coordinated"
391         "${WEBCORE_DIR}/platform/graphics/texmap/threadedcompositor"
392     )
393     list(APPEND WebCore_SOURCES
394         page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
395         page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp
396         page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp
397         page/scrolling/ScrollingStateStickyNode.cpp
398         page/scrolling/ScrollingThread.cpp
399         page/scrolling/ScrollingTreeNode.cpp
400         page/scrolling/ScrollingTreeScrollingNode.cpp
401         platform/graphics/TiledBackingStore.cpp
402         platform/graphics/texmap/coordinated/AreaAllocator.cpp
403         platform/graphics/texmap/coordinated/CompositingCoordinator.cpp
404         platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
405         platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp
406         platform/graphics/texmap/coordinated/CoordinatedSurface.cpp
407         platform/graphics/texmap/coordinated/CoordinatedTile.cpp
408         platform/graphics/texmap/coordinated/UpdateAtlas.cpp
409     )
410 endif ()
411
412 if (WTF_USE_EGL)
413     list(APPEND WebCore_LIBRARIES
414         ${EGL_LIBRARY}
415     )
416 endif ()
417
418 if (WTF_USE_OPENGL_ES_2)
419     list(APPEND WebCore_SOURCES
420         platform/graphics/opengl/Extensions3DOpenGLES.cpp
421         platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp
422     )
423 endif ()
424
425 if (WTF_USE_OPENGL)
426     list(APPEND WebCore_SOURCES
427         platform/graphics/OpenGLShims.cpp
428
429         platform/graphics/opengl/Extensions3DOpenGL.cpp
430         platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
431     )
432 endif ()
433
434 if (ENABLE_PLUGIN_PROCESS_GTK2)
435     # WebKitPluginProcess2 needs a version of WebCore compiled against GTK+2, so we've isolated all the GTK+
436     # dependent files into a separate library which can be used to construct a GTK+2 WebCore
437     # for the plugin process.
438     add_library(WebCorePlatformGTK2 ${WebCore_LIBRARY_TYPE} ${WebCorePlatformGTK_SOURCES})
439     add_dependencies(WebCorePlatformGTK2 WebCore)
440     WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebCorePlatformGTK2)
441     set_property(TARGET WebCorePlatformGTK2
442         APPEND
443         PROPERTY COMPILE_DEFINITIONS GTK_API_VERSION_2=1
444     )
445     set_property(
446         TARGET WebCorePlatformGTK2
447         APPEND
448         PROPERTY INCLUDE_DIRECTORIES
449             ${WebCore_INCLUDE_DIRECTORIES}
450             ${GTK2_INCLUDE_DIRS}
451             ${GDK2_INCLUDE_DIRS}
452     )
453     target_link_libraries(WebCorePlatformGTK2
454          ${WebCore_LIBRARIES}
455          ${GTK2_LIBRARIES}
456          ${GDK2_LIBRARIES}
457     )
458 endif ()
459
460 # Wayland protocol extension.
461 add_custom_command(
462     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandClientProtocol.c
463     DEPENDS ${WEBCORE_DIR}/platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml
464     COMMAND wayland-scanner server-header < ${WEBCORE_DIR}/platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml > ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandServerProtocol.h
465     COMMAND wayland-scanner client-header < ${WEBCORE_DIR}/platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml > ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandClientProtocol.h
466     COMMAND wayland-scanner code < ${WEBCORE_DIR}/platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml > ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandClientProtocol.c
467 )
468
469 if (ENABLE_WAYLAND_TARGET)
470     list(APPEND WebCorePlatformGTK_SOURCES
471         platform/graphics/wayland/WaylandDisplay.cpp
472         platform/graphics/wayland/WaylandEventSource.cpp
473         platform/graphics/wayland/WaylandSurface.cpp
474
475         ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandClientProtocol.c
476     )
477
478     list(APPEND WebCore_INCLUDE_DIRECTORIES
479         ${WAYLAND_INCLUDE_DIRS}
480     )
481     list(APPEND WebCore_LIBRARIES
482         ${WAYLAND_LIBRARIES}
483     )
484 endif ()
485
486 add_library(WebCorePlatformGTK ${WebCore_LIBRARY_TYPE} ${WebCorePlatformGTK_SOURCES})
487 add_dependencies(WebCorePlatformGTK WebCore)
488 WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebCorePlatformGTK)
489 set_property(
490     TARGET WebCorePlatformGTK
491     APPEND
492     PROPERTY INCLUDE_DIRECTORIES
493         ${WebCore_INCLUDE_DIRECTORIES}
494         ${GTK_INCLUDE_DIRS}
495         ${GDK_INCLUDE_DIRS}
496 )
497 target_link_libraries(WebCorePlatformGTK
498     ${WebCore_LIBRARIES}
499     ${GTK_LIBRARIES}
500     ${GDK_LIBRARIES}
501 )
502
503 include_directories(
504     ${WebCore_INCLUDE_DIRECTORIES}
505     "${WEBCORE_DIR}/bindings/gobject/"
506     "${DERIVED_SOURCES_DIR}"
507     "${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}"
508 )
509
510 list(APPEND GObjectDOMBindings_SOURCES
511     bindings/gobject/ConvertToUTF8String.cpp
512     bindings/gobject/DOMObjectCache.cpp
513     bindings/gobject/GObjectEventListener.cpp
514     bindings/gobject/GObjectNodeFilterCondition.cpp
515     bindings/gobject/GObjectXPathNSResolver.cpp
516     bindings/gobject/WebKitDOMCustom.cpp
517     bindings/gobject/WebKitDOMDeprecated.cpp
518     bindings/gobject/WebKitDOMEventTarget.cpp
519     bindings/gobject/WebKitDOMHTMLPrivate.cpp
520     bindings/gobject/WebKitDOMNodeFilter.cpp
521     bindings/gobject/WebKitDOMObject.cpp
522     bindings/gobject/WebKitDOMPrivate.cpp
523     bindings/gobject/WebKitDOMXPathNSResolver.cpp
524     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
525     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines-unstable.h
526     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
527 )
528
529 list(APPEND GObjectDOMBindingsStable_IDL_FILES
530     css/CSSRule.idl
531     css/CSSRuleList.idl
532     css/CSSStyleDeclaration.idl
533     css/CSSStyleSheet.idl
534     css/CSSValue.idl
535     css/MediaList.idl
536     css/StyleSheet.idl
537     css/StyleSheetList.idl
538
539     dom/Attr.idl
540     dom/CDATASection.idl
541     dom/CharacterData.idl
542     dom/Comment.idl
543     dom/DOMImplementation.idl
544     dom/Document.idl
545     dom/DocumentFragment.idl
546     dom/DocumentType.idl
547     dom/Element.idl
548     dom/EntityReference.idl
549     dom/Event.idl
550     dom/KeyboardEvent.idl
551     dom/MouseEvent.idl
552     dom/NamedNodeMap.idl
553     dom/Node.idl
554     dom/NodeIterator.idl
555     dom/NodeList.idl
556     dom/ProcessingInstruction.idl
557     dom/Range.idl
558     dom/Text.idl
559     dom/TreeWalker.idl
560     dom/UIEvent.idl
561     dom/WheelEvent.idl
562
563     fileapi/Blob.idl
564     fileapi/File.idl
565     fileapi/FileList.idl
566
567     html/HTMLAnchorElement.idl
568     html/HTMLAppletElement.idl
569     html/HTMLAreaElement.idl
570     html/HTMLBRElement.idl
571     html/HTMLBaseElement.idl
572     html/HTMLBaseFontElement.idl
573     html/HTMLBodyElement.idl
574     html/HTMLButtonElement.idl
575     html/HTMLCanvasElement.idl
576     html/HTMLCollection.idl
577     html/HTMLDListElement.idl
578     html/HTMLDirectoryElement.idl
579     html/HTMLDivElement.idl
580     html/HTMLDocument.idl
581     html/HTMLElement.idl
582     html/HTMLEmbedElement.idl
583     html/HTMLFieldSetElement.idl
584     html/HTMLFontElement.idl
585     html/HTMLFormElement.idl
586     html/HTMLFrameElement.idl
587     html/HTMLFrameSetElement.idl
588     html/HTMLHRElement.idl
589     html/HTMLHeadElement.idl
590     html/HTMLHeadingElement.idl
591     html/HTMLHtmlElement.idl
592     html/HTMLIFrameElement.idl
593     html/HTMLImageElement.idl
594     html/HTMLInputElement.idl
595     html/HTMLLIElement.idl
596     html/HTMLLabelElement.idl
597     html/HTMLLegendElement.idl
598     html/HTMLLinkElement.idl
599     html/HTMLMapElement.idl
600     html/HTMLMarqueeElement.idl
601     html/HTMLMenuElement.idl
602     html/HTMLMetaElement.idl
603     html/HTMLModElement.idl
604     html/HTMLOListElement.idl
605     html/HTMLObjectElement.idl
606     html/HTMLOptGroupElement.idl
607     html/HTMLOptionElement.idl
608     html/HTMLOptionsCollection.idl
609     html/HTMLParagraphElement.idl
610     html/HTMLParamElement.idl
611     html/HTMLPreElement.idl
612     html/HTMLQuoteElement.idl
613     html/HTMLScriptElement.idl
614     html/HTMLSelectElement.idl
615     html/HTMLStyleElement.idl
616     html/HTMLTableCaptionElement.idl
617     html/HTMLTableCellElement.idl
618     html/HTMLTableColElement.idl
619     html/HTMLTableElement.idl
620     html/HTMLTableRowElement.idl
621     html/HTMLTableSectionElement.idl
622     html/HTMLTextAreaElement.idl
623     html/HTMLTitleElement.idl
624     html/HTMLUListElement.idl
625
626     page/DOMWindow.idl
627
628     xml/XPathExpression.idl
629     xml/XPathResult.idl
630 )
631
632 list(APPEND GObjectDOMBindingsUnstable_IDL_FILES
633     Modules/battery/BatteryManager.idl
634
635     Modules/gamepad/deprecated/Gamepad.idl
636     Modules/gamepad/deprecated/GamepadList.idl
637
638     Modules/geolocation/Geolocation.idl
639
640     Modules/mediasource/VideoPlaybackQuality.idl
641
642     Modules/mediastream/MediaDevices.idl
643     Modules/mediastream/NavigatorMediaDevices.idl
644
645     Modules/quota/StorageInfo.idl
646     Modules/quota/StorageQuota.idl
647
648     Modules/speech/DOMWindowSpeechSynthesis.idl
649     Modules/speech/SpeechSynthesis.idl
650     Modules/speech/SpeechSynthesisEvent.idl
651     Modules/speech/SpeechSynthesisUtterance.idl
652     Modules/speech/SpeechSynthesisVoice.idl
653
654     Modules/webdatabase/Database.idl
655
656     css/DOMWindowCSS.idl
657     css/MediaQueryList.idl
658     css/StyleMedia.idl
659
660     dom/DOMNamedFlowCollection.idl
661     dom/DOMStringList.idl
662     dom/DOMStringMap.idl
663     dom/MessagePort.idl
664     dom/Touch.idl
665     dom/WebKitNamedFlow.idl
666
667     html/DOMSettableTokenList.idl
668     html/DOMTokenList.idl
669     html/HTMLDetailsElement.idl
670     html/HTMLKeygenElement.idl
671     html/HTMLMediaElement.idl
672     html/MediaController.idl
673     html/MediaError.idl
674     html/TimeRanges.idl
675     html/ValidityState.idl
676
677     loader/appcache/DOMApplicationCache.idl
678
679     page/BarProp.idl
680     page/DOMSecurityPolicy.idl
681     page/DOMSelection.idl
682     page/History.idl
683     page/Location.idl
684     page/Navigator.idl
685     page/Performance.idl
686     page/PerformanceEntry.idl
687     page/PerformanceEntryList.idl
688     page/PerformanceNavigation.idl
689     page/PerformanceTiming.idl
690     page/Screen.idl
691     page/UserMessageHandler.idl
692     page/UserMessageHandlersNamespace.idl
693     page/WebKitPoint.idl
694     page/WebKitNamespace.idl
695
696     plugins/DOMMimeType.idl
697     plugins/DOMMimeTypeArray.idl
698     plugins/DOMPlugin.idl
699     plugins/DOMPluginArray.idl
700
701     storage/Storage.idl
702 )
703
704 if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
705     list(APPEND GObjectDOMBindingsUnstable_IDL_FILES
706         html/HTMLAudioElement.idl
707         html/HTMLVideoElement.idl
708
709         html/track/AudioTrack.idl
710         html/track/AudioTrackList.idl
711         html/track/DataCue.idl
712         html/track/TextTrack.idl
713         html/track/TextTrackCue.idl
714         html/track/TextTrackCueList.idl
715         html/track/TextTrackList.idl
716         html/track/TrackEvent.idl
717         html/track/VTTCue.idl
718         html/track/VideoTrack.idl
719         html/track/VideoTrackList.idl
720     )
721 endif ()
722
723 if (ENABLE_QUOTA)
724     list(APPEND GObjectDOMBindingsUnstable_IDL_FILES
725         Modules/quota/DOMWindowQuota.idl
726         Modules/quota/NavigatorStorageQuota.idl
727         Modules/quota/StorageErrorCallback.idl
728         Modules/quota/StorageInfo.idl
729         Modules/quota/StorageQuota.idl
730         Modules/quota/StorageQuotaCallback.idl
731         Modules/quota/StorageUsageCallback.idl
732         Modules/quota/WorkerNavigatorStorageQuota.idl
733     )
734 endif ()
735
736 set(GObjectDOMBindings_STATIC_CLASS_LIST Custom Deprecated EventTarget NodeFilter Object XPathNSResolver)
737
738 set(GObjectDOMBindingsStable_CLASS_LIST ${GObjectDOMBindings_STATIC_CLASS_LIST})
739 set(GObjectDOMBindingsStable_INSTALLED_HEADERS
740      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
741      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
742      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMCustom.h
743      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMDeprecated.h
744      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMEventTarget.h
745      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMNodeFilter.h
746      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMObject.h
747      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMXPathNSResolver.h
748 )
749
750 set(GObjectDOMBindingsUnstable_INSTALLED_HEADERS
751      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines-unstable.h
752      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMCustomUnstable.h
753 )
754
755 foreach (file ${GObjectDOMBindingsStable_IDL_FILES})
756     get_filename_component(classname ${file} NAME_WE)
757     list(APPEND GObjectDOMBindingsStable_CLASS_LIST ${classname})
758     list(APPEND GObjectDOMBindingsStable_INSTALLED_HEADERS ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}.h)
759     list(APPEND GObjectDOMBindingsUnstable_INSTALLED_HEADERS ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}Unstable.h)
760 endforeach ()
761
762 foreach (file ${GObjectDOMBindingsUnstable_IDL_FILES})
763     get_filename_component(classname ${file} NAME_WE)
764     list(APPEND GObjectDOMBindingsUnstable_CLASS_LIST ${classname})
765     list(APPEND GObjectDOMBindingsUnstable_INSTALLED_HEADERS ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}.h)
766 endforeach ()
767
768 set(GOBJECT_DOM_BINDINGS_FEATURES_DEFINES "LANGUAGE_GOBJECT=1 ${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}")
769 string(REPLACE "ENABLE_INDEXED_DATABASE=1" "" GOBJECT_DOM_BINDINGS_FEATURES_DEFINES ${GOBJECT_DOM_BINDINGS_FEATURES_DEFINES})
770 string(REPLACE REGEX "ENABLE_SVG[A-Z_]+=1" "" GOBJECT_DOM_BINDINGS_FEATURES_DEFINES ${GOBJECT_DOM_BINDINGS_FEATURES_DEFINES})
771
772 file(MAKE_DIRECTORY ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR})
773
774 add_custom_command(
775     OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
776     DEPENDS ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl
777     COMMAND echo ${GObjectDOMBindingsStable_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl defines > ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
778 )
779
780 add_custom_command(
781     OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines-unstable.h
782     DEPENDS ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl
783     COMMAND echo ${GObjectDOMBindingsUnstable_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl defines-unstable > ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines-unstable.h
784 )
785
786 add_custom_command(
787     OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
788     DEPENDS ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl
789     COMMAND echo ${GObjectDOMBindingsStable_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl gdom > ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
790 )
791
792 # Some of the static headers are included by generated public headers with include <webkitdom/WebKitDOMFoo.h>.
793 # We need those headers in the derived sources to be in webkitdom directory.
794 set(GObjectDOMBindings_STATIC_HEADER_NAMES ${GObjectDOMBindings_STATIC_CLASS_LIST} CustomUnstable)
795 foreach (classname ${GObjectDOMBindings_STATIC_HEADER_NAMES})
796     add_custom_command(
797         OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}.h
798         DEPENDS ${WEBCORE_DIR}/bindings/gobject/WebKitDOM${classname}.h
799         COMMAND ln -n -s -f ${WEBCORE_DIR}/bindings/gobject/WebKitDOM${classname}.h ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}
800     )
801     list(APPEND GObjectDOMBindings_STATIC_GENERATED_SOURCES ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}.h)
802 endforeach ()
803
804 add_custom_target(fake-generated-webkitdom-headers
805     DEPENDS ${GObjectDOMBindings_STATIC_GENERATED_SOURCES}
806 )
807
808 set(GObjectDOMBindings_IDL_FILES ${GObjectDOMBindingsStable_IDL_FILES} ${GObjectDOMBindingsUnstable_IDL_FILES})
809 set(ADDITIONAL_BINDINGS_DEPENDENCIES
810     ${WEBCORE_DIR}/bindings/gobject/webkitdom.symbols
811     ${WINDOW_CONSTRUCTORS_FILE}
812     ${WORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
813     ${DEDICATEDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
814 )
815 GENERATE_BINDINGS(GObjectDOMBindings_SOURCES
816     "${GObjectDOMBindings_IDL_FILES}"
817     "${WEBCORE_DIR}"
818     "${IDL_INCLUDES}"
819     "${GOBJECT_DOM_BINDINGS_FEATURES_DEFINES}"
820     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}
821     WebKitDOM GObject cpp
822     ${IDL_ATTRIBUTES_FILE}
823     ${SUPPLEMENTAL_DEPENDENCY_FILE}
824     ${ADDITIONAL_BINDINGS_DEPENDENCIES})
825
826 add_definitions(-DBUILDING_WEBKIT)
827 add_definitions(-DWEBKIT_DOM_USE_UNSTABLE_API)
828
829 add_library(GObjectDOMBindings STATIC ${GObjectDOMBindings_SOURCES})
830
831 WEBKIT_SET_EXTRA_COMPILER_FLAGS(GObjectDOMBindings)
832
833 add_dependencies(GObjectDOMBindings
834     WebCore
835     fake-generated-webkitdom-headers
836 )
837
838 file(WRITE ${CMAKE_BINARY_DIR}/gtkdoc-webkitdom.cfg
839     "[webkitdomgtk-${WEBKITGTK_API_VERSION}]\n"
840     "pkgconfig_file=${WebKit2_PKGCONFIG_FILE}\n"
841     "namespace=webkit_dom\n"
842     "cflags=-I${CMAKE_SOURCE_DIR}/Source\n"
843     "       -I${WEBCORE_DIR}/bindings\n"
844     "       -I${WEBCORE_DIR}/bindings/gobject\n"
845     "       -I${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}\n"
846     "doc_dir=${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/docs\n"
847     "source_dirs=${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}\n"
848     "            ${WEBCORE_DIR}/bindings/gobject\n"
849     "headers=${GObjectDOMBindingsStable_INSTALLED_HEADERS}\n"
850     "main_sgml_file=webkitdomgtk-docs.sgml\n"
851 )
852
853 install(FILES ${GObjectDOMBindingsStable_INSTALLED_HEADERS}
854         DESTINATION "${WEBKITGTK_HEADER_INSTALL_DIR}/webkitdom"
855 )
856
857 # Make unstable header optional if they don't exist
858 install(FILES ${GObjectDOMBindingsUnstable_INSTALLED_HEADERS}
859         DESTINATION "${WEBKITGTK_HEADER_INSTALL_DIR}/webkitdom"
860         OPTIONAL
861 )
862
863 # Some installed headers are not on the list of headers used for gir generation.
864 set(GObjectDOMBindings_GIR_HEADERS ${GObjectDOMBindingsStable_INSTALLED_HEADERS})
865 list(REMOVE_ITEM GObjectDOMBindings_GIR_HEADERS
866      bindings/gobject/WebKitDOMEventTarget.h
867      bindings/gobject/WebKitDOMNodeFilter.h
868      bindings/gobject/WebKitDOMObject.h
869      bindings/gobject/WebKitDOMXPathNSResolver.h
870 )
871
872 # Propagate this variable to the parent scope, so that it can be used in other parts of the build.
873 set(GObjectDOMBindings_GIR_HEADERS ${GObjectDOMBindings_GIR_HEADERS} PARENT_SCOPE)
874
875 if (ENABLE_SUBTLE_CRYPTO)
876     list(APPEND WebCore_SOURCES
877         crypto/CryptoAlgorithm.cpp
878         crypto/CryptoAlgorithmDescriptionBuilder.cpp
879         crypto/CryptoAlgorithmRegistry.cpp
880         crypto/CryptoKey.cpp
881         crypto/CryptoKeyPair.cpp
882         crypto/SubtleCrypto.cpp
883         crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
884         crypto/algorithms/CryptoAlgorithmAES_KW.cpp
885         crypto/algorithms/CryptoAlgorithmHMAC.cpp
886         crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
887         crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
888         crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
889         crypto/algorithms/CryptoAlgorithmSHA1.cpp
890         crypto/algorithms/CryptoAlgorithmSHA224.cpp
891         crypto/algorithms/CryptoAlgorithmSHA256.cpp
892         crypto/algorithms/CryptoAlgorithmSHA384.cpp
893         crypto/algorithms/CryptoAlgorithmSHA512.cpp
894
895         crypto/gnutls/CryptoAlgorithmRegistryGnuTLS.cpp
896         crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp
897         crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp
898         crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp
899         crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp
900         crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp
901         crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp
902         crypto/gnutls/CryptoDigestGnuTLS.cpp
903         crypto/gnutls/CryptoKeyRSAGnuTLS.cpp
904         crypto/gnutls/SerializedCryptoKeyWrapGnuTLS.cpp
905
906         crypto/keys/CryptoKeyAES.cpp
907         crypto/keys/CryptoKeyDataOctetSequence.cpp
908         crypto/keys/CryptoKeyDataRSAComponents.cpp
909         crypto/keys/CryptoKeyHMAC.cpp
910         crypto/keys/CryptoKeySerializationRaw.cpp
911     )
912
913     list(APPEND WebCore_INCLUDE_DIRECTORIES
914         ${GNUTLS_INCLUDE_DIRS}
915     )
916     list(APPEND WebCore_LIBRARIES
917         ${GNUTLS_LIBRARIES}
918     )
919 endif ()