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