c41caa5fcbdda12ea81e035d6eb7259f4e2cbfc1
[WebKit-https.git] / Source / WebCore / PlatformGTK.cmake
1 include(platform/Cairo.cmake)
2 include(platform/FreeType.cmake)
3 include(platform/GCrypt.cmake)
4 include(platform/GStreamer.cmake)
5 include(platform/ImageDecoders.cmake)
6 include(platform/TextureMapper.cmake)
7
8 set(WebCore_OUTPUT_NAME WebCoreGTK)
9
10 list(APPEND WebCore_UNIFIED_SOURCE_LIST_FILES
11     "SourcesGTK.txt"
12
13     "platform/SourcesGLib.txt"
14     "platform/SourcesSoup.txt"
15 )
16
17 list(APPEND WebCore_INCLUDE_DIRECTORIES
18     "${THIRDPARTY_DIR}/ANGLE/"
19     "${THIRDPARTY_DIR}/ANGLE/include/KHR"
20     "${WEBCORE_DIR}/accessibility/atk"
21     "${WEBCORE_DIR}/editing/atk"
22     "${WEBCORE_DIR}/page/gtk"
23     "${WEBCORE_DIR}/platform/geoclue"
24     "${WEBCORE_DIR}/platform/gtk"
25     "${WEBCORE_DIR}/platform/graphics/egl"
26     "${WEBCORE_DIR}/platform/graphics/glx"
27     "${WEBCORE_DIR}/platform/graphics/gstreamer"
28     "${WEBCORE_DIR}/platform/graphics/gtk"
29     "${WEBCORE_DIR}/platform/graphics/opengl"
30     "${WEBCORE_DIR}/platform/graphics/opentype"
31     "${WEBCORE_DIR}/platform/graphics/wayland"
32     "${WEBCORE_DIR}/platform/graphics/x11"
33     "${WEBCORE_DIR}/platform/mediacapabilities"
34     "${WEBCORE_DIR}/platform/mediastream/gtk"
35     "${WEBCORE_DIR}/platform/mediastream/gstreamer"
36     "${WEBCORE_DIR}/platform/mock/mediasource"
37     "${WEBCORE_DIR}/platform/network/gtk"
38     "${WEBCORE_DIR}/platform/network/soup"
39     "${WEBCORE_DIR}/platform/text/gtk"
40 )
41
42 list(APPEND WebCorePlatformGTK_SOURCES
43     editing/gtk/EditorGtk.cpp
44
45     page/gtk/DragControllerGtk.cpp
46
47     platform/glib/EventHandlerGLib.cpp
48
49     platform/graphics/PlatformDisplay.cpp
50
51     platform/graphics/gtk/ColorGtk.cpp
52     platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp
53     platform/graphics/gtk/GdkCairoUtilities.cpp
54     platform/graphics/gtk/IconGtk.cpp
55     platform/graphics/gtk/ImageBufferGtk.cpp
56     platform/graphics/gtk/ImageGtk.cpp
57
58     platform/gtk/CursorGtk.cpp
59     platform/gtk/DragImageGtk.cpp
60     platform/gtk/GRefPtrGtk.cpp
61     platform/gtk/GtkUtilities.cpp
62     platform/gtk/GtkVersioning.c
63     platform/gtk/PasteboardHelper.cpp
64     platform/gtk/PlatformKeyboardEventGtk.cpp
65     platform/gtk/PlatformMouseEventGtk.cpp
66     platform/gtk/PlatformPasteboardGtk.cpp
67     platform/gtk/PlatformScreenGtk.cpp
68     platform/gtk/PlatformWheelEventGtk.cpp
69     platform/gtk/RenderThemeGadget.cpp
70     platform/gtk/RenderThemeWidget.cpp
71     platform/gtk/ScrollbarThemeGtk.cpp
72     platform/gtk/WidgetGtk.cpp
73
74     rendering/RenderThemeGtk.cpp
75 )
76
77 if (ENABLE_GEOLOCATION)
78     list(APPEND WebCore_SOURCES
79         ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c
80     )
81     execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable dbus_interface geoclue-2.0 OUTPUT_VARIABLE GEOCLUE_DBUS_INTERFACE)
82     add_custom_command(
83          OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.h
84          COMMAND gdbus-codegen --interface-prefix org.freedesktop.GeoClue2. --c-namespace Geoclue --generate-c-code ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface ${GEOCLUE_DBUS_INTERFACE}
85     )
86     set_source_files_properties(${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
87 endif ()
88
89 list(APPEND WebCore_USER_AGENT_STYLE_SHEETS
90     ${WEBCORE_DIR}/css/mediaControlsGtk.css
91 )
92
93 set(WebCore_USER_AGENT_SCRIPTS
94     ${WEBCORE_DIR}/en.lproj/mediaControlsLocalizedStrings.js
95     ${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsBase.js
96     ${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsGtk.js
97 )
98
99 set(WebCore_USER_AGENT_SCRIPTS_DEPENDENCIES ${WEBCORE_DIR}/platform/gtk/RenderThemeGtk.cpp)
100
101 list(APPEND WebCore_LIBRARIES
102     ${ATK_LIBRARIES}
103     ${CAIRO_LIBRARIES}
104     ${ENCHANT_LIBRARIES}
105     ${GLIB_GIO_LIBRARIES}
106     ${GLIB_GMODULE_LIBRARIES}
107     ${GLIB_GOBJECT_LIBRARIES}
108     ${GLIB_LIBRARIES}
109     ${LIBSECCOMP_LIBRARIES}
110     ${LIBSECRET_LIBRARIES}
111     ${LIBSOUP_LIBRARIES}
112     ${LIBTASN1_LIBRARIES}
113     ${HYPHEN_LIBRARIES}
114     ${UPOWERGLIB_LIBRARIES}
115     ${X11_X11_LIB}
116     ${X11_Xcomposite_LIB}
117     ${X11_Xdamage_LIB}
118     ${X11_Xrender_LIB}
119     ${X11_Xt_LIB}
120     ${ZLIB_LIBRARIES}
121 )
122
123 list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
124     ${ATK_INCLUDE_DIRS}
125     ${CAIRO_INCLUDE_DIRS}
126     ${ENCHANT_INCLUDE_DIRS}
127     ${GIO_UNIX_INCLUDE_DIRS}
128     ${GLIB_INCLUDE_DIRS}
129     ${LIBSECCOMP_INCLUDE_DIRS}
130     ${LIBSECRET_INCLUDE_DIRS}
131     ${LIBSOUP_INCLUDE_DIRS}
132     ${LIBTASN1_INCLUDE_DIRS}
133     ${UPOWERGLIB_INCLUDE_DIRS}
134     ${ZLIB_INCLUDE_DIRS}
135 )
136
137 if (USE_OPENGL_ES)
138     list(APPEND WebCore_SOURCES
139         platform/graphics/opengl/Extensions3DOpenGLES.cpp
140         platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp
141     )
142 endif ()
143
144 if (USE_OPENGL)
145     list(APPEND WebCore_SOURCES
146         platform/graphics/OpenGLShims.cpp
147
148         platform/graphics/opengl/Extensions3DOpenGL.cpp
149         platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
150     )
151 endif ()
152
153 if (ENABLE_PLUGIN_PROCESS_GTK2)
154     # WebKitPluginProcess2 needs a version of WebCore compiled against GTK+2, so we've isolated all the GTK+
155     # dependent files into a separate library which can be used to construct a GTK+2 WebCore
156     # for the plugin process.
157     add_library(WebCorePlatformGTK2 ${WebCore_LIBRARY_TYPE} ${WebCorePlatformGTK_SOURCES})
158     add_dependencies(WebCorePlatformGTK2 WebCore)
159     set_property(TARGET WebCorePlatformGTK2
160         APPEND
161         PROPERTY COMPILE_DEFINITIONS GTK_API_VERSION_2=1
162     )
163     target_include_directories(WebCorePlatformGTK2 PRIVATE
164         ${WebCore_INCLUDE_DIRECTORIES}
165     )
166     target_include_directories(WebCorePlatformGTK2 SYSTEM PRIVATE
167         ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
168         ${GTK2_INCLUDE_DIRS}
169         ${GDK2_INCLUDE_DIRS}
170     )
171     target_link_libraries(WebCorePlatformGTK2
172          ${WebCore_LIBRARIES}
173          ${GTK2_LIBRARIES}
174          ${GDK2_LIBRARIES}
175     )
176 endif ()
177
178 if (ENABLE_WAYLAND_TARGET)
179     list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
180         ${WAYLAND_INCLUDE_DIRS}
181     )
182     list(APPEND WebCore_LIBRARIES
183         ${WAYLAND_LIBRARIES}
184     )
185 endif ()
186
187 add_library(WebCorePlatformGTK ${WebCore_LIBRARY_TYPE} ${WebCorePlatformGTK_SOURCES})
188 add_dependencies(WebCorePlatformGTK WebCore)
189 target_include_directories(WebCorePlatformGTK PRIVATE
190     ${WebCore_INCLUDE_DIRECTORIES}
191 )
192 target_include_directories(WebCorePlatformGTK SYSTEM PRIVATE
193     ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
194     ${GTK_INCLUDE_DIRS}
195     ${GDK_INCLUDE_DIRS}
196 )
197 target_link_libraries(WebCorePlatformGTK
198     ${WebCore_LIBRARIES}
199     ${GTK_LIBRARIES}
200     ${GDK_LIBRARIES}
201 )
202
203 include_directories(
204     ${WebCore_INCLUDE_DIRECTORIES}
205     "${WEBCORE_DIR}/bindings/gobject/"
206 )
207
208 include_directories(SYSTEM
209     ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
210 )
211
212 add_definitions(-DBUILDING_WEBKIT)
213
214 if (ENABLE_SMOOTH_SCROLLING)
215     list(APPEND WebCore_SOURCES
216         platform/ScrollAnimationSmooth.cpp
217     )
218 endif ()