Restrict X11 options to X11 device

This commit is contained in:
numzero 2023-03-06 14:21:58 +03:00
parent 5f76be9380
commit e484698ba2

@ -113,38 +113,32 @@ else()
set(DEVICE "X11")
endif()
if(USE_SDL2)
set(DEVICE "SDL")
endif()
option(USE_X11 "Use X11" TRUE)
if(USE_X11)
add_definitions(-D_IRR_COMPILE_WITH_X11_)
endif()
if(LINUX_PLATFORM)
add_definitions(-D_IRR_LINUX_PLATFORM_)
endif()
if(USE_SDL2)
set(DEVICE "SDL")
endif()
add_definitions("-D_IRR_COMPILE_WITH_${DEVICE}_DEVICE_")
# X11
if(DEVICE STREQUAL "X11")
option(USE_X11 "Use X11" TRUE)
else()
set(USE_X11 FALSE)
endif()
if(LINUX_PLATFORM AND USE_X11)
add_definitions(-D_IRR_COMPILE_WITH_X11_)
option(USE_XINPUT2 "Use XInput2" TRUE)
if(USE_XINPUT2)
add_definitions(-D_IRR_LINUX_X11_XINPUT2_)
endif()
option(USE_XCURSOR "Use XCursor" FALSE)
if(USE_XCURSOR)
add_definitions(-D_IRR_LINUX_XCURSOR_)
endif()
else()
set(USE_XINPUT2 FALSE)
set(USE_XCURSOR FALSE)
endif()
add_definitions("-D_IRR_COMPILE_WITH_${DEVICE}_DEVICE_")
# Joystick
if(NOT (BSD OR SOLARIS OR EMSCRIPTEN))
@ -421,6 +415,18 @@ elseif(APPLE)
)
endif()
if(USE_X11)
target_compile_definitions(IRROTHEROBJ PRIVATE _IRR_COMPILE_WITH_X11_)
endif()
if(USE_XINPUT2)
target_compile_definitions(IRROTHEROBJ PRIVATE _IRR_LINUX_X11_XINPUT2_)
endif()
if(USE_XCURSOR)
target_compile_definitions(IRROTHEROBJ PRIVATE _IRR_LINUX_XCURSOR_)
endif()
add_library(IRRGUIOBJ OBJECT
CGUIButton.cpp
CGUICheckBox.cpp