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