Title: [170663] trunk
Revision
170663
Author
zandober...@gmail.com
Date
2014-07-01 13:45:47 -0700 (Tue, 01 Jul 2014)

Log Message

[CMake] Add necessary support for building for the Wayland target
https://bugs.webkit.org/show_bug.cgi?id=134160

Reviewed by Darin Adler.


.: 
* Source/cmake/FindGTK3.cmake: Check for the gtk+-x11-3.0 package if the X11 target
is enabled, and that its version matches the version of the generic package. Same
for the gtk+-wayland-3.0 package and the Wayland target.
* Source/cmake/OptionsCommon.cmake: Don't add the -DXP_UNIX definition here.
* Source/cmake/OptionsEfl.cmake: Add -DXP_UNIX here for the EFL port, under the same
condition as in OptionsCommon.cmake. ENABLE_X11_TARGET is enabled by default for EFL
so they keep building the TestNetscapePlugin target.
* Source/cmake/OptionsGTK.cmake: Enable the X11 target and disable the Wayland target
by default. Group all the X11-specific macro definitions (WTF_PLATFORM_X11, MOZ_X11,
XP_UNIX) and only add them if the X11 target is enabled. Similar goes for the Wayland
target and WTF_PLATFORM_WAYLAND. The Wayland target requires GTK+ 3.12.0, so that's
the minimum required version as soon as that target is enabled. Only search for GLX
if the X11 target is enabled.

Tools: 
* CMakeLists.txt: Only build the TestNetscapePlugIn target in case
the X11 windowing target is enabled.

Modified Paths

Diff

Modified: trunk/ChangeLog (170662 => 170663)


--- trunk/ChangeLog	2014-07-01 20:38:37 UTC (rev 170662)
+++ trunk/ChangeLog	2014-07-01 20:45:47 UTC (rev 170663)
@@ -1,3 +1,24 @@
+2014-07-01  Zan Dobersek  <zdober...@igalia.com>
+
+        [CMake] Add necessary support for building for the Wayland target
+        https://bugs.webkit.org/show_bug.cgi?id=134160
+
+        Reviewed by Darin Adler.
+
+        * Source/cmake/FindGTK3.cmake: Check for the gtk+-x11-3.0 package if the X11 target
+        is enabled, and that its version matches the version of the generic package. Same
+        for the gtk+-wayland-3.0 package and the Wayland target.
+        * Source/cmake/OptionsCommon.cmake: Don't add the -DXP_UNIX definition here.
+        * Source/cmake/OptionsEfl.cmake: Add -DXP_UNIX here for the EFL port, under the same
+        condition as in OptionsCommon.cmake. ENABLE_X11_TARGET is enabled by default for EFL
+        so they keep building the TestNetscapePlugin target.
+        * Source/cmake/OptionsGTK.cmake: Enable the X11 target and disable the Wayland target
+        by default. Group all the X11-specific macro definitions (WTF_PLATFORM_X11, MOZ_X11,
+        XP_UNIX) and only add them if the X11 target is enabled. Similar goes for the Wayland
+        target and WTF_PLATFORM_WAYLAND. The Wayland target requires GTK+ 3.12.0, so that's
+        the minimum required version as soon as that target is enabled. Only search for GLX
+        if the X11 target is enabled.
+
 2014-06-29  Yoav Weiss  <y...@yoav.ws>
 
         Add support for HTMLImageElement's sizes attribute

Modified: trunk/Source/cmake/FindGTK3.cmake (170662 => 170663)


--- trunk/Source/cmake/FindGTK3.cmake	2014-07-01 20:38:37 UTC (rev 170662)
+++ trunk/Source/cmake/FindGTK3.cmake	2014-07-01 20:45:47 UTC (rev 170663)
@@ -45,5 +45,19 @@
     endif ()
 endif ()
 
+if (GTK3_VERSION AND VERSION_OK AND ENABLE_X11_TARGET)
+    pkg_check_modules(GTK3_X11 gtk+-x11-3.0)
+    if (NOT("${GTK3_X11_VERSION}" VERSION_EQUAL "${GTK3_VERSION}"))
+        set(VERSION_OK FALSE)
+    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(VERSION_OK FALSE)
+    endif ()
+endif ()
+
 include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK3 DEFAULT_MSG GTK3_INCLUDE_DIRS GTK3_LIBRARIES VERSION_OK)

Modified: trunk/Source/cmake/OptionsCommon.cmake (170662 => 170663)


--- trunk/Source/cmake/OptionsCommon.cmake	2014-07-01 20:38:37 UTC (rev 170662)
+++ trunk/Source/cmake/OptionsCommon.cmake	2014-07-01 20:45:47 UTC (rev 170663)
@@ -1,10 +1,6 @@
 add_definitions(-DBUILDING_WITH_CMAKE=1)
 add_definitions(-DHAVE_CONFIG_H=1)
 
-if (WTF_OS_UNIX)
-    add_definitions(-DXP_UNIX)
-endif (WTF_OS_UNIX)
-
 # CODE_GENERATOR_PREPROCESSOR_WITH_LINEMARKERS only matters with GCC >= 4.7.0.  Since this
 # version, -P does not output empty lines, which currently breaks make_names.pl in
 # WebCore. Investigating whether make_names.pl should be changed instead is left as an exercise to

Modified: trunk/Source/cmake/OptionsEfl.cmake (170662 => 170663)


--- trunk/Source/cmake/OptionsEfl.cmake	2014-07-01 20:38:37 UTC (rev 170662)
+++ trunk/Source/cmake/OptionsEfl.cmake	2014-07-01 20:45:47 UTC (rev 170663)
@@ -167,6 +167,11 @@
     set(ENABLE_PLUGIN_PROCESS 1)
 endif ()
 
+if (WTF_OS_UNIX)
+    set(ENABLE_X11_TARGET ON)
+    add_definitions(-DXP_UNIX)
+endif (WTF_OS_UNIX)
+
 if (ENABLE_BATTERY_STATUS OR (EFL_REQUIRED_VERSION VERSION_LESS 1.8))
     find_package(DBus REQUIRED)
     find_package(E_DBus 1.7 COMPONENTS EUKit)

Modified: trunk/Source/cmake/OptionsGTK.cmake (170662 => 170663)


--- trunk/Source/cmake/OptionsGTK.cmake	2014-07-01 20:38:37 UTC (rev 170662)
+++ trunk/Source/cmake/OptionsGTK.cmake	2014-07-01 20:45:47 UTC (rev 170663)
@@ -66,6 +66,21 @@
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETWORK_PROCESS ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(WTF_USE_TILED_BACKING_STORE OFF)
 
+set(ENABLE_X11_TARGET ON CACHE BOOL "Whether to enable support for the X11 windowing target.")
+set(ENABLE_WAYLAND_TARGET OFF CACHE BOOL "Whether to enable support for the Wayland windowing target.")
+
+if (ENABLE_X11_TARGET)
+    add_definitions(-DWTF_PLATFORM_X11=1)
+    add_definitions(-DMOZ_X11=1)
+    if (WTF_OS_UNIX)
+        add_definitions(-DXP_UNIX)
+    endif ()
+endif ()
+
+if (ENABLE_WAYLAND_TARGET)
+    add_definitions(-DWTF_PLATFORM_WAYLAND=1)
+endif ()
+
 # FIXME: Perhaps we need a more generic way of defining dependencies between features.
 # VIDEO_TRACK depends on VIDEO.
 if (NOT ENABLE_VIDEO AND ENABLE_VIDEO_TRACK)
@@ -142,10 +157,6 @@
     endif ()
 endif ()
 
-# FIXME: These need to be configurable.
-add_definitions(-DWTF_PLATFORM_X11=1)
-add_definitions(-DMOZ_X11)
-
 find_package(Cairo 1.10.2 REQUIRED)
 find_package(Fontconfig 2.8.0 REQUIRED)
 find_package(Freetype2 2.4.2 REQUIRED)
@@ -166,8 +177,14 @@
 find_package(ATSPI 2.5.3)
 find_package(GObjectIntrospection)
 
-find_package(GTK3 3.6.0 REQUIRED)
-find_package(GDK3 3.6.0 REQUIRED)
+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)
 set(GTK_LIBRARIES ${GTK3_LIBRARIES})
 set(GTK_INCLUDE_DIRS ${GTK3_INCLUDE_DIRS})
 set(GDK_LIBRARIES ${GDK3_LIBRARIES})
@@ -205,12 +222,18 @@
 # CMakePushCheckState can be used. We need to have OPENGL_INCLUDE_DIR as part
 # of the directories check_include_files() looks for in case OpenGL is
 # installed into a non-standard location.
-set(REQUIRED_INCLUDES_OLD ${CMAKE_REQUIRED_INCLUDES})
-set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${OPENGL_INCLUDE_DIR})
-# We don't use find_package for GLX because it is part of -lGL, unlike EGL.
-check_include_files("GL/glx.h" GLX_FOUND)
-set(CMAKE_REQUIRED_INCLUDES ${REQUIRED_INCLUDES_OLD})
+if (ENABLE_X11_TARGET)
+    set(REQUIRED_INCLUDES_OLD ${CMAKE_REQUIRED_INCLUDES})
+    set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${OPENGL_INCLUDE_DIR})
+    # We don't use find_package for GLX because it is part of -lGL, unlike EGL.
+    check_include_files("GL/glx.h" GLX_FOUND)
+    set(CMAKE_REQUIRED_INCLUDES ${REQUIRED_INCLUDES_OLD})
 
+    if (GLX_FOUND)
+        set(WTF_USE_GLX 1)
+    endif ()
+endif ()
+
 find_package(EGL)
 if (EGL_FOUND)
     set(WTF_USE_EGL 1)

Modified: trunk/Tools/CMakeLists.txt (170662 => 170663)


--- trunk/Tools/CMakeLists.txt	2014-07-01 20:38:37 UTC (rev 170662)
+++ trunk/Tools/CMakeLists.txt	2014-07-01 20:45:47 UTC (rev 170663)
@@ -13,7 +13,9 @@
         add_subdirectory(MiniBrowser/gtk)
         add_subdirectory(TestWebKitAPI/Tests/WebKit2Gtk)
     endif ()
-    add_subdirectory(DumpRenderTree/TestNetscapePlugIn)
+    if (ENABLE_X11_TARGET)
+        add_subdirectory(DumpRenderTree/TestNetscapePlugIn)
+    endif ()
 elseif ("${PORT}" STREQUAL "WinCE")
     add_subdirectory(WinCELauncher)
 endif ()

Modified: trunk/Tools/ChangeLog (170662 => 170663)


--- trunk/Tools/ChangeLog	2014-07-01 20:38:37 UTC (rev 170662)
+++ trunk/Tools/ChangeLog	2014-07-01 20:45:47 UTC (rev 170663)
@@ -1,3 +1,13 @@
+2014-07-01  Zan Dobersek  <zdober...@igalia.com>
+
+        [CMake] Add necessary support for building for the Wayland target
+        https://bugs.webkit.org/show_bug.cgi?id=134160
+
+        Reviewed by Darin Adler.
+
+        * CMakeLists.txt: Only build the TestNetscapePlugIn target in case
+        the X11 windowing target is enabled.
+
 2014-07-01  Chris Fleizach  <cfleiz...@apple.com>
 
         AX: HTML indeterminate IDL attribute not mapped to checkbox value=2
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to