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