cmake: Make xrandr and xcomposite required

They were required before, but could technically be deactived (the
compilation would fail, but configuration was possible).

The WITH_XRANDR and WITH_XCOMPOSITE now no longer appear in the cmake
part. It still appears in the source code, but is always set to 1

Fixes #1536
This commit is contained in:
patrick96 2020-12-21 22:15:05 +01:00 committed by Patrick Ziegler
parent 374716d329
commit 1dc8d2f30e
9 changed files with 15 additions and 32 deletions

View File

@ -77,7 +77,7 @@ endif()
set(MODULES_LEFT "bspwm i3")
set(MODULES_CENTER "mpd")
set(MODULES_RIGHT "filesystem xbacklight alsa pulseaudio xkeyboard memory cpu wlan eth battery temperature date powermenu")
set(MODULES_RIGHT "filesystem backlight-acpi alsa pulseaudio xkeyboard memory cpu wlan eth battery temperature date powermenu")
set(FONT_FIXED "fixed:pixelsize=10")
set(FONT_UNIFONT "unifont:fontformat=truetype")
@ -104,9 +104,6 @@ endif()
if(NOT ENABLE_NETWORK)
string(REPLACE " wlan eth" "" MODULES_RIGHT ${MODULES_RIGHT})
endif()
if(NOT WITH_XRANDR)
string(REPLACE "xbacklight " "backlight-acpi " MODULES_RIGHT ${MODULES_RIGHT})
endif()
if(NOT WITH_XKB)
string(REPLACE "xkeyboard " "" MODULES_RIGHT ${MODULES_RIGHT})
endif()

View File

@ -42,9 +42,7 @@ option(ENABLE_NETWORK "Enable network support" ON)
option(ENABLE_XKEYBOARD "Enable xkeyboard support" ON)
option(ENABLE_PULSEAUDIO "Enable PulseAudio support" ON)
option(WITH_XRANDR "xcb-randr support" ON)
option(WITH_XRANDR_MONITORS "xcb-randr monitor support" ON)
option(WITH_XCOMPOSITE "xcb-composite support" ON)
option(WITH_XKB "xcb-xkb support" ON)
option(WITH_XRM "xcb-xrm support" ON)
option(WITH_XCURSOR "xcb-cursor support" ON)

View File

@ -34,17 +34,16 @@ if (ENABLE_PULSEAUDIO)
set(PULSEAUDIO_VERSION ${LibPulse_VERSION})
endif()
if (WITH_XCOMPOSITE)
set(XORG_EXTENSIONS ${XORG_EXTENSIONS} COMPOSITE)
endif()
# xcomposite is required
list(APPEND XORG_EXTENSIONS COMPOSITE)
if (WITH_XKB)
set(XORG_EXTENSIONS ${XORG_EXTENSIONS} XKB)
list(APPEND XORG_EXTENSIONS XKB)
endif()
if (WITH_XCURSOR)
set(XORG_EXTENSIONS ${XORG_EXTENSIONS} CURSOR)
list(APPEND XORG_EXTENSIONS CURSOR)
endif()
if (WITH_XRM)
set(XORG_EXTENSIONS ${XORG_EXTENSIONS} XRM)
list(APPEND XORG_EXTENSIONS XRM)
endif()
# Set min xrandr version required

View File

@ -30,9 +30,9 @@ colored_option(" pulseaudio" ENABLE_PULSEAUDIO PULSEAUDIO_VERSION)
colored_option(" xkeyboard" WITH_XKB Xcb_XKB_VERSION)
message(STATUS " X extensions:")
colored_option(" xcb-randr" WITH_XRANDR Xcb_RANDR_VERSION)
colored_option(" xcb-randr" Xcb_RANDR_FOUND Xcb_RANDR_VERSION)
colored_option(" xcb-randr (monitor support)" WITH_XRANDR_MONITORS Xcb_RANDR_VERSION)
colored_option(" xcb-composite" WITH_XCOMPOSITE Xcb_COMPOSITE_VERSION)
colored_option(" xcb-composite" Xcb_COMPOSITE_FOUND Xcb_COMPOSITE_VERSION)
colored_option(" xcb-xkb" WITH_XKB Xcb_XKB_VERSION)
colored_option(" xcb-xrm" WITH_XRM Xcb_XRM_VERSION)
colored_option(" xcb-cursor" WITH_XCURSOR Xcb_CURSOR_VERSION)

View File

@ -32,7 +32,6 @@ cmake \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DBUILD_TESTS:BOOL="${BUILD_TESTS:-OFF}" \
-DBUILD_DOC:BOOL="${BUILD_DOC:-OFF}" \
-DWITH_XRANDR=ON \
-DENABLE_PULSEAUDIO="${ENABLE_PULSEAUDIO:-OFF}" \
-DENABLE_NETWORK="${ENABLE_NETWORK:-OFF}" \
-DENABLE_MPD="${ENABLE_MPD:-OFF}" \

View File

@ -2,12 +2,8 @@
# Generate settings.hpp
#
if(WITH_XRANDR)
list(APPEND XPP_EXTENSION_LIST xpp::randr::extension)
endif()
if(WITH_XCOMPOSITE)
list(APPEND XPP_EXTENSION_LIST xpp::composite::extension)
endif()
list(APPEND XPP_EXTENSION_LIST xpp::randr::extension)
list(APPEND XPP_EXTENSION_LIST xpp::composite::extension)
if(WITH_XKB)
list(APPEND XPP_EXTENSION_LIST xpp::xkb::extension)
endif()

View File

@ -15,8 +15,8 @@ extern const char* const APP_VERSION;
#cmakedefine01 ENABLE_CURL
#cmakedefine01 ENABLE_PULSEAUDIO
#cmakedefine01 WITH_XRANDR
#cmakedefine01 WITH_XCOMPOSITE
#define WITH_XRANDR 1
#define WITH_XCOMPOSITE 1
#cmakedefine01 WITH_XKB
#cmakedefine01 WITH_XRM
#cmakedefine01 WITH_XCURSOR

View File

@ -12,12 +12,8 @@ target_include_directories(moodycamel SYSTEM INTERFACE ${CMAKE_CURRENT_LIST_DIR}
set(XCB_PROTOS xproto)
if(WITH_XRANDR)
list(APPEND XCB_PROTOS randr)
endif()
if(WITH_XCOMPOSITE)
list(APPEND XCB_PROTOS composite)
endif()
list(APPEND XCB_PROTOS randr)
list(APPEND XCB_PROTOS composite)
if(WITH_XKB)
list(APPEND XCB_PROTOS xkb)
endif()

View File

@ -36,8 +36,6 @@ set(PULSEAUDIO_SOURCES
${src_dir}/modules/pulseaudio.cpp
)
set(XCOMPOSITE_SOURCES ${src_dir}/x11/extensions/composite.cpp)
set(XCURSOR_SOURCES ${src_dir}/x11/cursor.cpp)
set(XKB_SOURCES
@ -119,6 +117,7 @@ set(POLY_SOURCES
${src_dir}/x11/background_manager.cpp
${src_dir}/x11/connection.cpp
${src_dir}/x11/ewmh.cpp
${src_dir}/x11/extensions/composite.cpp
${src_dir}/x11/extensions/randr.cpp
${src_dir}/x11/icccm.cpp
${src_dir}/x11/registry.cpp
@ -134,7 +133,6 @@ set(POLY_SOURCES
$<$<BOOL:${ENABLE_MPD}>:${MPD_SOURCES}>
$<$<BOOL:${ENABLE_NETWORK}>:${NETWORK_SOURCES}>
$<$<BOOL:${ENABLE_PULSEAUDIO}>:${PULSEAUDIO_SOURCES}>
$<$<BOOL:${WITH_XCOMPOSITE}>:${XCOMPOSITE_SOURCES}>
$<$<BOOL:${WITH_XCURSOR}>:${XCURSOR_SOURCES}>
$<$<BOOL:${WITH_XKB}>:${XKB_SOURCES}>
$<$<BOOL:${WITH_XRM}>:${XRM_SOURCES}>