[GTK] r186800 broke the build on Ubuntu 14.04
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Aug 2015 19:13:39 +0000 (19:13 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Aug 2015 19:13:39 +0000 (19:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147559

Reviewed by Martin Robinson.

* Source/cmake/FindGTK3.cmake: Always define GTK3_SUPPORTS_X11 and GTK3_SUPPORTS_WAYLAND.
* Source/cmake/OptionsGTK.cmake: Autodetect support for X11 and Wayland backends.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188929 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/cmake/FindGTK3.cmake
Source/cmake/OptionsGTK.cmake

index 3400d65..ed45263 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-08-25  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [GTK] r186800 broke the build on Ubuntu 14.04
+        https://bugs.webkit.org/show_bug.cgi?id=147559
+
+        Reviewed by Martin Robinson.
+
+        * Source/cmake/FindGTK3.cmake: Always define GTK3_SUPPORTS_X11 and GTK3_SUPPORTS_WAYLAND.
+        * Source/cmake/OptionsGTK.cmake: Autodetect support for X11 and Wayland backends.
+
 2015-08-25  Per Arne Vollan  <peavo@outlook.com>
 
         [Win] Build does not generate debug info.
index 37d5a00..6bc2649 100644 (file)
@@ -52,11 +52,15 @@ if (GTK3_VERSION AND VERSION_OK)
     pkg_check_modules(GTK3_X11 gtk+-x11-3.0)
     if ("${GTK3_X11_VERSION}" VERSION_EQUAL "${GTK3_VERSION}")
         set(GTK3_SUPPORTS_X11 TRUE)
+    else ()
+        set(GTK3_SUPPORTS_X11 FALSE)
     endif ()
 
     pkg_check_modules(GTK3_WAYLAND gtk+-wayland-3.0)
     if ("${GTK3_WAYLAND_VERSION}" VERSION_EQUAL "${GTK3_VERSION}")
         set(GTK3_SUPPORTS_WAYLAND TRUE)
+    else ()
+        set(GTK3_SUPPORTS_WAYLAND FALSE)
     endif ()
 
     if (NOT("${GTK3_VERSION}" VERSION_LESS "3.14.0"))
index 6267bff..71efa11 100644 (file)
@@ -33,6 +33,8 @@ set(INTROSPECTION_INSTALL_TYPELIBDIR "${LIB_INSTALL_DIR}/girepository-1.0")
 find_package(Cairo 1.10.2 REQUIRED)
 find_package(Fontconfig 2.8.0 REQUIRED)
 find_package(Freetype2 2.4.2 REQUIRED)
+find_package(GTK3 3.6.0 REQUIRED)
+find_package(GDK3 3.6.0 REQUIRED)
 find_package(HarfBuzz 0.9.2 REQUIRED)
 find_package(ICU REQUIRED)
 find_package(JPEG REQUIRED)
@@ -47,6 +49,7 @@ find_package(ATK REQUIRED)
 find_package(WebP REQUIRED)
 find_package(ATSPI 2.5.3)
 find_package(EGL)
+find_package(GTKUnixPrint)
 find_package(OpenGL)
 find_package(OpenGLES2)
 
@@ -68,8 +71,8 @@ WEBKIT_OPTION_DEFINE(ENABLE_GTKDOC "Whether or not to use generate gtkdoc." PUBL
 WEBKIT_OPTION_DEFINE(ENABLE_INTROSPECTION "Whether to enable GObject introspection." PUBLIC ON)
 WEBKIT_OPTION_DEFINE(ENABLE_OPENGL "Whether to use OpenGL." PUBLIC ON)
 WEBKIT_OPTION_DEFINE(ENABLE_PLUGIN_PROCESS_GTK2 "Whether to build WebKitPluginProcess2 to load GTK2 based plugins." PUBLIC ON)
-WEBKIT_OPTION_DEFINE(ENABLE_X11_TARGET "Whether to enable support for the X11 windowing target." PUBLIC ON)
-WEBKIT_OPTION_DEFINE(ENABLE_WAYLAND_TARGET "Whether to enable support for the Wayland windowing target." PUBLIC ON)
+WEBKIT_OPTION_DEFINE(ENABLE_X11_TARGET "Whether to enable support for the X11 windowing target." PUBLIC ${GTK3_SUPPORTS_X11})
+WEBKIT_OPTION_DEFINE(ENABLE_WAYLAND_TARGET "Whether to enable support for the Wayland windowing target." PUBLIC ${GTK3_SUPPORTS_WAYLAND})
 WEBKIT_OPTION_DEFINE(USE_LIBNOTIFY "Whether to enable the default web notification implementation." PUBLIC ON)
 WEBKIT_OPTION_DEFINE(USE_LIBHYPHEN "Whether to enable the default automatic hyphenation implementation." PUBLIC ON)
 
@@ -224,16 +227,6 @@ add_definitions(-DUSER_AGENT_GTK_MAJOR_VERSION=602)
 add_definitions(-DUSER_AGENT_GTK_MINOR_VERSION=1)
 add_definitions(-DWEBKITGTK_API_VERSION_STRING="${WEBKITGTK_API_VERSION}")
 
-if (ENABLE_WAYLAND_TARGET)
-    set(GTK3_REQUIRED_VERSION 3.12.0)
-else ()
-    set(GTK3_REQUIRED_VERSION 3.6.0)
-endif ()
-
-find_package(GTK3 ${GTK3_REQUIRED_VERSION} REQUIRED)
-find_package(GDK3 ${GTK3_REQUIRED_VERSION} REQUIRED)
-find_package(GTKUnixPrint)
-
 set(GTK_LIBRARIES ${GTK3_LIBRARIES})
 set(GTK_INCLUDE_DIRS ${GTK3_INCLUDE_DIRS})
 set(GDK_LIBRARIES ${GDK3_LIBRARIES})
@@ -424,6 +417,10 @@ if (ENABLE_WAYLAND_TARGET)
         message(FATAL_ERROR "Recompile GTK+ with Wayland backend to use ENABLE_WAYLAND_TARGET")
     endif ()
 
+    if (ENABLE_WAYLAND_TARGET AND GTK3_VERSION VERSION_LESS 3.12)
+        message(FATAL_ERROR "GTK+ 3.12 is required to use ENABLE_WAYLAND_TARGET")
+    endif ()
+
     find_package(Wayland REQUIRED)
 endif ()