[Piglit] [PATCH v2 1/2] cmake: require libxkbcommon when building with Wayland

Tapani Pälli tapani.palli at intel.com
Wed Nov 2 11:16:26 UTC 2016


This enables us to support keys properly on Wayland backend.

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 CMakeLists.txt            | 7 +++++++
 tests/util/CMakeLists.txt | 5 +++++
 2 files changed, 12 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4002fe9..3964dd8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -151,6 +151,13 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
 	if (WAYLAND_FOUND)
 		set(PIGLIT_HAS_WAYLAND True)
 		add_definitions(-DPIGLIT_HAS_WAYLAND)
+
+		FIND_LIBRARY(HAVE_XKBCOMMON NAMES xkbcommon)
+		if(NOT HAVE_XKBCOMMON)
+			message(FATAL_ERROR "Wayland support requires xkbcommon. "
+				"Failed to find xkbcommon library.")
+		endif()
+		pkg_check_modules(XKBCOMMON QUIET xkbcommon)
 	endif()
 
 	pkg_check_modules(LIBDRM QUIET libdrm)
diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt
index 277386e..f197d84 100644
--- a/tests/util/CMakeLists.txt
+++ b/tests/util/CMakeLists.txt
@@ -17,6 +17,11 @@ if(HAVE_LIBCACA)
     link_libraries(caca)
 endif()
 
+if(HAVE_XKBCOMMON)
+	link_libraries(${XKBCOMMON_LIBRARIES})
+	include_directories(${XKBCOMMON_INCLUDE_DIRS})
+endif()
+
 if(PNG_FOUND)
 	link_libraries(${PNG_LIBRARIES})
 	include_directories(${PNG_INCLUDE_DIRS})
-- 
2.7.4



More information about the Piglit mailing list