From 9fcfd679b49a015e95f70b3f0380243e0db8b035 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 19 Sep 2022 20:21:01 +0100 Subject: [PATCH] Stop trying to include X11 headers in non-GTK builds. In commit 732ec31a17a7fea I made the check for libX11 conditional on GTK - but I forgot that if we're building without GTK, I should _define_ NOT_X_WINDOWS, rather than leaving it undefined. As a result, the build would fail on files like unix/utils/x11_ignore_error.c. --- cmake/platforms/unix.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/platforms/unix.cmake b/cmake/platforms/unix.cmake index 98474485..4d056d0a 100644 --- a/cmake/platforms/unix.cmake +++ b/cmake/platforms/unix.cmake @@ -96,6 +96,10 @@ if(GTK_FOUND) endif() endfunction() check_x11() +else() + # If we didn't even have GTK, behave as if X11 is not available. + # (There's nothing useful we could do with it even if there was.) + set(NOT_X_WINDOWS ON) endif() include_directories(${CMAKE_SOURCE_DIR}/charset ${GTK_INCLUDE_DIRS} ${X11_INCLUDE_DIR})