Don't require X11 in CMake builds using Wayland-only GTK

X11 headers and libraries are only required if we're actually using X11
which may not be the case.

This allows to build wxGTK on the systems using Wayland-only GTK.
This commit is contained in:
Vadim Zeitlin
2021-03-01 13:09:06 +01:00
parent a8e918727a
commit 9a84e0b25e
2 changed files with 10 additions and 6 deletions

View File

@@ -46,5 +46,6 @@ endif ()
include(CheckSymbolExists)
set(CMAKE_REQUIRED_INCLUDES ${GTK3_INCLUDE_DIRS})
check_symbol_exists(GDK_WINDOWING_WAYLAND "gdk/gdk.h" wxHAVE_GDK_WAYLAND)
check_symbol_exists(GDK_WINDOWING_X11 "gdk/gdk.h" wxHAVE_GDK_X11)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK3 DEFAULT_MSG GTK3_INCLUDE_DIRS GTK3_LIBRARIES VERSION_OK)