Allow override of wayland-scanner executable
authorMaíra Canal <mcanal@igalia.com>
Thu, 24 Nov 2022 09:52:39 +0000 (10:52 +0100)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 1 Dec 2022 23:40:35 +0000 (23:40 +0000)
When cross-compiling, if the environment variables
PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_LIBDIR are set to the target
sysroot, the wayland_scanner executable won't be found and the
compilation will fail as the xdg-shell header cannot be generated.
Therefore, allow overriding the wayland-scanner executable so that an
alternative executable can be provided with the variable
WAYLAND_SCANNER.

VK-GL-CTS issue: 4139
Components: Framework

Change-Id: I7848a353e93dd07638afadada9c3e0b96ffb5406

framework/platform/CMakeLists.txt

index 7584d2c..00c53e3 100644 (file)
@@ -74,7 +74,10 @@ if (NOT DEFINED TCUTIL_PLATFORM_SRCS)
                        include_directories(lnx/wayland)
 
                        pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
-                       pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner)
+
+                       if (NOT WAYLAND_SCANNER)
+                               pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner)
+                       endif()
 
                        set(DEQP_XDG_SHELL_PROTOCOL ${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml)
                        set(DEQP_XDG_SHELL_GEN_OUTPUTS_DIR ${PROJECT_BINARY_DIR}/framework/platform)