From f3eb89121db00c959daf374c8712f15860276b52 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 9 Dec 2020 14:29:33 +1000 Subject: [PATCH] Move the XTest check to cmake Where the ifdef was checked, the alternative was a compiler error. We can shortcut that process and just fail in cmake where the header is not found. --- CMakeLists.txt | 4 ++++ res/config.h.in | 3 --- src/lib/platform/IXWindowsImpl.h | 6 +----- src/lib/platform/XWindowsKeyState.h | 6 +----- src/lib/platform/XWindowsScreenSaver.cpp | 6 +----- 5 files changed, 7 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c57eeb9..2fb555a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,6 +200,10 @@ if (UNIX) set (HAVE_DPMS_PROTOTYPES 1) endif() + if (NOT HAVE_X11_EXTENSIONS_XTEST_H) + message (FATAL_ERROR "Missing header: X11/extensions/XTest.h") + endif() + if (NOT HAVE_X11_XKBLIB_H) message (FATAL_ERROR "Missing header: " ${XKBlib}) endif() diff --git a/res/config.h.in b/res/config.h.in index b04930a1..eb1e34fb 100644 --- a/res/config.h.in +++ b/res/config.h.in @@ -115,9 +115,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_X11_EXTENSIONS_XKBSTR_H ${HAVE_X11_EXTENSIONS_XKBSTR_H} -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_X11_EXTENSIONS_XTEST_H ${HAVE_X11_EXTENSIONS_XTEST_H} - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_X11_XKBLIB_H ${HAVE_X11_XKBLIB_H} diff --git a/src/lib/platform/IXWindowsImpl.h b/src/lib/platform/IXWindowsImpl.h index 8a190a84..37c59b22 100644 --- a/src/lib/platform/IXWindowsImpl.h +++ b/src/lib/platform/IXWindowsImpl.h @@ -13,11 +13,7 @@ # include } #endif -#if HAVE_X11_EXTENSIONS_XTEST_H -# include -#else -# error The XTest extension is required to build barrier -#endif +#include #if HAVE_X11_EXTENSIONS_XINERAMA_H // Xinerama.h may lack extern "C" for inclusion by C++ extern "C" { diff --git a/src/lib/platform/XWindowsKeyState.h b/src/lib/platform/XWindowsKeyState.h index d48a2af4..cad1d533 100644 --- a/src/lib/platform/XWindowsKeyState.h +++ b/src/lib/platform/XWindowsKeyState.h @@ -24,11 +24,7 @@ #include "XWindowsImpl.h" #include -#if HAVE_X11_EXTENSIONS_XTEST_H -# include -#else -# error The XTest extension is required to build barrier -#endif +#include #if HAVE_XKB_EXTENSION # include #endif diff --git a/src/lib/platform/XWindowsScreenSaver.cpp b/src/lib/platform/XWindowsScreenSaver.cpp index 5c4ef913..a02fdfd5 100644 --- a/src/lib/platform/XWindowsScreenSaver.cpp +++ b/src/lib/platform/XWindowsScreenSaver.cpp @@ -26,11 +26,7 @@ #include "base/TMethodEventJob.h" #include -#if HAVE_X11_EXTENSIONS_XTEST_H -# include -#else -# error The XTest extension is required to build barrier -#endif +#include #if HAVE_X11_EXTENSIONS_DPMS_H extern "C" { # include