diff --git a/CMakeLists.txt b/CMakeLists.txt index 57f8e8eed..d2857e6f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,6 +111,7 @@ elseif(APPLE) elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|DragonFly|GNU") option(BUILD_WSI_XCB_SUPPORT "Build XCB WSI support" ON) option(BUILD_WSI_XLIB_SUPPORT "Build Xlib WSI support" ON) + option(BUILD_WSI_XLIB_XRANDR_SUPPORT "Build X11 Xrandr WSI support" ON) option(BUILD_WSI_WAYLAND_SUPPORT "Build Wayland WSI support" ON) option(BUILD_WSI_DIRECTFB_SUPPORT "Build DirectFB WSI support" OFF) @@ -125,8 +126,14 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|DragonFly|GNU") if(BUILD_WSI_XLIB_SUPPORT) pkg_check_modules(X11 REQUIRED QUIET IMPORTED_TARGET x11) pkg_get_variable(XLIB_INCLUDE_DIRS x11 includedir) - target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_XLIB_KHR VK_USE_PLATFORM_XLIB_XRANDR_EXT) + target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_XLIB_KHR) target_include_directories(platform_wsi INTERFACE ${XLIB_INCLUDE_DIRS}) + if(BUILD_WSI_XLIB_XRANDR_SUPPORT) + pkg_check_modules(XRANDR REQUIRED QUIET IMPORTED_TARGET xrandr) + pkg_get_variable(XLIB_XRANDR_INCLUDE_DIRS xrandr includedir) + target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_XLIB_XRANDR_EXT) + target_include_directories(platform_wsi INTERFACE ${XLIB_XRANDR_INCLUDE_DIRS}) + endif() endif() if(BUILD_WSI_WAYLAND_SUPPORT) target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_WAYLAND_KHR)