Title: [185788] trunk
Revision
185788
Author
mcatanz...@igalia.com
Date
2015-06-19 19:41:09 -0700 (Fri, 19 Jun 2015)

Log Message

[CMake] FindGTK3.cmake should not modify the values of build options
https://bugs.webkit.org/show_bug.cgi?id=144613

Reviewed by Martin Robinson.

* Source/cmake/FindGTK3.cmake: Do not check or set the value of ENABLE_X11_TARGET and
ENABLE_WAYLAND_TARGET. Instead, simply define the variables GTK3_SUPPORTS_X11 and
GTK3_SUPPORTS_WAYLAND as appropriate. Also, rename GTK_SUPPORTS_GESTURES to
GTK3_SUPPORTS_GESTURES for consistency.
* Source/cmake/OptionsGTK.cmake: Fail the build if the appropriate GTK+ backend is not
available. It's not possible to automatically select a backend correctly anymore, since all
options are set at the same time.

Modified Paths

Diff

Modified: trunk/ChangeLog (185787 => 185788)


--- trunk/ChangeLog	2015-06-20 01:46:17 UTC (rev 185787)
+++ trunk/ChangeLog	2015-06-20 02:41:09 UTC (rev 185788)
@@ -1,3 +1,18 @@
+2015-06-19  Michael Catanzaro  <mcatanz...@igalia.com>
+
+        [CMake] FindGTK3.cmake should not modify the values of build options
+        https://bugs.webkit.org/show_bug.cgi?id=144613
+
+        Reviewed by Martin Robinson.
+
+        * Source/cmake/FindGTK3.cmake: Do not check or set the value of ENABLE_X11_TARGET and
+        ENABLE_WAYLAND_TARGET. Instead, simply define the variables GTK3_SUPPORTS_X11 and
+        GTK3_SUPPORTS_WAYLAND as appropriate. Also, rename GTK_SUPPORTS_GESTURES to
+        GTK3_SUPPORTS_GESTURES for consistency.
+        * Source/cmake/OptionsGTK.cmake: Fail the build if the appropriate GTK+ backend is not
+        available. It's not possible to automatically select a backend correctly anymore, since all
+        options are set at the same time.
+
 2015-06-19  Csaba Osztrogonác  <o...@webkit.org>
 
         Remove unnecessary svn:executable flags

Modified: trunk/Source/cmake/FindGTK3.cmake (185787 => 185788)


--- trunk/Source/cmake/FindGTK3.cmake	2015-06-20 01:46:17 UTC (rev 185787)
+++ trunk/Source/cmake/FindGTK3.cmake	2015-06-20 02:41:09 UTC (rev 185788)
@@ -4,9 +4,12 @@
 #  GTK3_FOUND - system has GTK+ 3.
 #  GTK3_INCLUDE_DIRS - the GTK+ 3. include directories
 #  GTK3_LIBRARIES - link these to use GTK+ 3.
+#  GTK3_SUPPORTS_GESTURES - GTK+ supports gestures (GTK+ >= 3.14)
+#  GTK3_SUPPORTS_X11 - GTK+ supports X11 backend
+#  GTK3_SUPPORTS_WAYLAND - GTK+ supports Wayland backend
 #
 # Copyright (C) 2012 Raphael Kubo da Costa <rak...@webkit.org>
-# Copyright (C) 2013 Igalia S.L.
+# Copyright (C) 2013, 2015 Igalia S.L.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -45,30 +48,23 @@
     endif ()
 endif ()
 
-if (GTK3_VERSION AND VERSION_OK AND ENABLE_X11_TARGET)
+if (GTK3_VERSION AND VERSION_OK)
     pkg_check_modules(GTK3_X11 gtk+-x11-3.0)
-    if (NOT("${GTK3_X11_VERSION}" VERSION_EQUAL "${GTK3_VERSION}"))
-        set(ENABLE_X11_TARGET OFF)
+    if ("${GTK3_X11_VERSION}" VERSION_EQUAL "${GTK3_VERSION}")
+        set(GTK3_SUPPORTS_X11 TRUE)
     endif ()
-endif ()
 
-if (GTK3_VERSION AND VERSION_OK AND ENABLE_WAYLAND_TARGET)
     pkg_check_modules(GTK3_WAYLAND gtk+-wayland-3.0)
-    if (NOT("${GTK3_WAYLAND_VERSION}" VERSION_EQUAL "${GTK3_VERSION}"))
-        set(ENABLE_WAYLAND_TARGET OFF)
+    if ("${GTK3_WAYLAND_VERSION}" VERSION_EQUAL "${GTK3_VERSION}")
+        set(GTK3_SUPPORTS_WAYLAND TRUE)
     endif ()
-endif ()
 
-if (NOT(ENABLE_X11_TARGET OR ENABLE_WAYLAND_TARGET))
-    message(FATAL_ERROR "At least one of the following windowing targets must "
-        "be enabled and also supported by the GTK+ dependency: X11, Wayland")
+    if (NOT("${GTK3_VERSION}" VERSION_LESS "3.14.0"))
+        set(GTK3_SUPPORTS_GESTURES ON)
+    else ()
+        set(GTK3_SUPPORTS_GESTURES OFF)
+    endif ()
 endif ()
 
-if (GTK3_VERSION AND VERSION_OK AND NOT("${GTK3_VERSION}" VERSION_LESS "3.14.0"))
-    set(GTK_SUPPORTS_GESTURES ON)
-else ()
-    set(GTK_SUPPORTS_GESTURES OFF)
-endif ()
-
 include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK3 DEFAULT_MSG GTK3_INCLUDE_DIRS GTK3_LIBRARIES VERSION_OK)

Modified: trunk/Source/cmake/OptionsGTK.cmake (185787 => 185788)


--- trunk/Source/cmake/OptionsGTK.cmake	2015-06-20 01:46:17 UTC (rev 185787)
+++ trunk/Source/cmake/OptionsGTK.cmake	2015-06-20 02:41:09 UTC (rev 185788)
@@ -237,8 +237,8 @@
 set(GDK_LIBRARIES ${GDK3_LIBRARIES})
 set(GDK_INCLUDE_DIRS ${GDK3_INCLUDE_DIRS})
 
+SET_AND_EXPOSE_TO_BUILD(HAVE_GTK_GESTURES ${GTK3_SUPPORTS_GESTURES})
 SET_AND_EXPOSE_TO_BUILD(HAVE_GTK_UNIX_PRINTING ${GTK_UNIX_PRINT_FOUND})
-SET_AND_EXPOSE_TO_BUILD(HAVE_GTK_GESTURES ${GTK_SUPPORTS_GESTURES})
 
 set(glib_components gio gobject gthread gmodule)
 if (ENABLE_GAMEPAD_DEPRECATED OR ENABLE_GEOLOCATION)
@@ -378,6 +378,10 @@
 endif ()
 
 if (ENABLE_X11_TARGET)
+    if (NOT GTK3_SUPPORTS_X11)
+        message(FATAL_ERROR "Recompile GTK+ with X11 backend to use ENABLE_X11_TARGET")
+    endif ()
+
     find_package(X11 REQUIRED)
     if (NOT X11_Xcomposite_FOUND)
         message(FATAL_ERROR "libXcomposite is required for ENABLE_X11_TARGET")
@@ -391,6 +395,10 @@
 endif ()
 
 if (ENABLE_WAYLAND_TARGET)
+    if (NOT GTK3_SUPPORTS_WAYLAND)
+        message(FATAL_ERROR "Recompile GTK+ with Wayland backend to use ENABLE_WAYLAND_TARGET")
+    endif ()
+
     find_package(Wayland REQUIRED)
 endif ()
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to