[build] push-to-talk feature should be configurable, not (poorly) auto-detected at build time
Hello,
Trying to build Jami on my GNU/Linux, X11 machine in a clean environment (where $XDG_SESSION_TYPE is not set), I was curious why it printed:
CMake Warning at CMakeLists.txt:529 (message):
Global push-to-talk not supported.
The CMakeLists.txt code responsible for the detection does:
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(STATUS "CMAKE_SYSTEM_NAME IS LINUX")
if (DEFINED ENV{XDG_SESSION_TYPE})
if ($ENV{XDG_SESSION_TYPE} STREQUAL "x11")
set(PTT_PLATFORM "x11")
list(APPEND COMMON_HEADER ${APP_SRC_DIR}/platform/X11/xcbkeyboard.H)
# TODO: add Wayland support
endif ()
endif ()
This is bound to fail in containerized environment, and there's no clean way to declare we want support for it (except for setting the XDG_SESSION_TYPE environment variable to x11 ourselves, which is ugly/not easily discoverable). A CMake option such as 'ENABLE_X11_PUSH_TO_TALK" defaulting to AUTO could be used (current behavior). Setting it to ON would force the feature on and assume the user know what they are doing.