Unreviewed, rolling out r226094.
[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     ${LIBTASN1_LIBRARIES}
108     ${HYPHEN_LIBRARIES}
109     ${UPOWERGLIB_LIBRARIES}
110     ${X11_X11_LIB}
111     ${X11_Xcomposite_LIB}
112     ${X11_Xdamage_LIB}
113     ${X11_Xrender_LIB}
114     ${X11_Xt_LIB}
115     ${ZLIB_LIBRARIES}
116     WTF
117 )
118
119 list(APPEND WebCoreTestSupport_LIBRARIES WTF)
120
121 list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
122     ${ATK_INCLUDE_DIRS}
123     ${CAIRO_INCLUDE_DIRS}
124     ${ENCHANT_INCLUDE_DIRS}
125     ${GIO_UNIX_INCLUDE_DIRS}
126     ${GLIB_INCLUDE_DIRS}
127     ${LIBSECRET_INCLUDE_DIRS}
128     ${LIBSOUP_INCLUDE_DIRS}
129     ${LIBTASN1_INCLUDE_DIRS}
130     ${UPOWERGLIB_INCLUDE_DIRS}
131     ${ZLIB_INCLUDE_DIRS}
132 )
133
134 if (USE_OPENGL_ES_2)
135     list(APPEND WebCore_SOURCES
136         platform/graphics/opengl/Extensions3DOpenGLES.cpp
137         platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp
138     )
139 endif ()
140
141 if (USE_OPENGL)
142     list(APPEND WebCore_SOURCES
143         platform/graphics/OpenGLShims.cpp
144
145         platform/graphics/opengl/Extensions3DOpenGL.cpp
146         platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
147     )
148 endif ()
149
150 if (ENABLE_PLUGIN_PROCESS_GTK2)
151     # WebKitPluginProcess2 needs a version of WebCore compiled against GTK+2, so we've isolated all the GTK+
152     # dependent files into a separate library which can be used to construct a GTK+2 WebCore
153     # for the plugin process.
154     add_library(WebCorePlatformGTK2 ${WebCore_LIBRARY_TYPE} ${WebCorePlatformGTK_SOURCES})
155     add_dependencies(WebCorePlatformGTK2 WebCore)
156     set_property(TARGET WebCorePlatformGTK2
157         APPEND
158         PROPERTY COMPILE_DEFINITIONS GTK_API_VERSION_2=1
159     )
160     target_include_directories(WebCorePlatformGTK2 PRIVATE
161         ${WebCore_INCLUDE_DIRECTORIES}
162         ${GTK2_INCLUDE_DIRS}
163         ${GDK2_INCLUDE_DIRS}
164     )
165     target_include_directories(WebCorePlatformGTK2 SYSTEM PRIVATE
166         ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
167     )
168     target_link_libraries(WebCorePlatformGTK2
169          ${WebCore_LIBRARIES}
170          ${GTK2_LIBRARIES}
171          ${GDK2_LIBRARIES}
172     )
173 endif ()
174
175 if (ENABLE_WAYLAND_TARGET)
176     list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
177         ${WAYLAND_INCLUDE_DIRS}
178     )
179     list(APPEND WebCore_LIBRARIES
180         ${WAYLAND_LIBRARIES}
181     )
182 endif ()
183
184 add_library(WebCorePlatformGTK ${WebCore_LIBRARY_TYPE} ${WebCorePlatformGTK_SOURCES})
185 add_dependencies(WebCorePlatformGTK WebCore)
186 target_include_directories(WebCorePlatformGTK PRIVATE
187     ${WebCore_INCLUDE_DIRECTORIES}
188 )
189 target_include_directories(WebCorePlatformGTK SYSTEM PRIVATE
190     ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
191     ${GTK_INCLUDE_DIRS}
192     ${GDK_INCLUDE_DIRS}
193 )
194 target_link_libraries(WebCorePlatformGTK
195     ${WebCore_LIBRARIES}
196     ${GTK_LIBRARIES}
197     ${GDK_LIBRARIES}
198 )
199
200 include_directories(
201     ${WebCore_INCLUDE_DIRECTORIES}
202     "${WEBCORE_DIR}/bindings/gobject/"
203 )
204
205 include_directories(SYSTEM
206     ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
207 )
208
209 add_definitions(-DBUILDING_WEBKIT)
210
211 if (ENABLE_SMOOTH_SCROLLING)
212     list(APPEND WebCore_SOURCES
213         platform/ScrollAnimationSmooth.cpp
214     )
215 endif ()