Bug 150353 - [CMake] GTK3 version is too low to support Wayland when Wayland is enabled.
Summary: [CMake] GTK3 version is too low to support Wayland when Wayland is enabled.
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-19 20:11 PDT by Sean Wang
Modified: 2019-05-17 09:41 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Wang 2015-10-19 20:11:41 PDT
When I run cmake build in my ubuntu 14.04 64-bit, cmake reports following errors:

CMake Error at Source/cmake/OptionsGTK.cmake:418 (message):
  GTK+ 3.12 is required to use ENABLE_WAYLAND_TARGET
Call Stack (most recent call first):
  CMakeLists.txt:123 (include)

My GTK+3 and Wayland version is 3.10.8 which is less than 3.12, but the Source/cmake/FindGTK3.cmake:61 set the GTK3_SUPPORTS_WAYLAND to true.
        set(GTK3_SUPPORTS_WAYLAND TRUE)

Should the FindGTK3.cmake limit the GTK+3 version to 3.12 to enable wayland? Like the following:

diff --git a/Source/cmake/FindGTK3.cmake b/Source/cmake/FindGTK3.cmake
index 6bc2649..f708dae 100644
--- a/Source/cmake/FindGTK3.cmake
+++ b/Source/cmake/FindGTK3.cmake
@@ -57,7 +57,7 @@ if (GTK3_VERSION AND VERSION_OK)
     endif ()
 
diff --git a/Source/cmake/FindGTK3.cmake b/Source/cmake/FindGTK3.cmake
index 6bc2649..d9eb88c 100644
--- a/Source/cmake/FindGTK3.cmake
+++ b/Source/cmake/FindGTK3.cmake
@@ -57,7 +57,7 @@ if (GTK3_VERSION AND VERSION_OK)
     endif ()
 
     pkg_check_modules(GTK3_WAYLAND gtk+-wayland-3.0)
-    if ("${GTK3_WAYLAND_VERSION}" VERSION_EQUAL "${GTK3_VERSION}")
+    if ("${GTK3_WAYLAND_VERSION}" VERSION_EQUAL "${GTK3_VERSION}" AND NOT("${GTK3_WAYLAND_VERSION}" VERSION_LESS "3.12"))
         set(GTK3_SUPPORTS_WAYLAND TRUE)
     else ()
         set(GTK3_SUPPORTS_WAYLAND FALSE)
Comment 1 Michael Catanzaro 2015-10-25 16:06:02 PDT
I don't care much, but the change is harmless, so feel free to submit it as a patch if you want; see: http://www.webkit.org/coding/contributing.html
Comment 2 Carlos Alberto Lopez Perez 2015-11-18 11:59:51 PST
You can also disable the wayland target (is enabled by default) if you don't want to run webkitgtk+ on wayland.

Passing -DENABLE_WAYLAND_TARGET=OFF to cmake will do that.

If you use the script build-webkit you can do that as follows:

Tools/Scripts/build-webkit --gtk --release --cmakeargs='-DENABLE_WAYLAND_TARGET=OFF'


Regarding your proposed patch, maybe a better alternative would be to lower the required GTK+ version to 3.10 when building wayland. I'm not sure if we really require 3.12 or we can lower this requirement to 3.10

You can try this patch:

--- a/Source/cmake/OptionsGTK.cmake
+++ b/Source/cmake/OptionsGTK.cmake
@@ -433,8 +433,8 @@ 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")
+    if (ENABLE_WAYLAND_TARGET AND GTK3_VERSION VERSION_LESS 3.10)
+        message(FATAL_ERROR "GTK+ 3.10 is required to use ENABLE_WAYLAND_TARGET")
     endif ()
 
     find_package(Wayland REQUIRED)


And try to see if everything build ok (including the wayland target)
Comment 3 Lionir 2019-05-16 21:02:43 PDT
I believe this can be closed, we use above 3.12 for a while now.