From 4ec1fbf2017e9f7f1e28bec1d38ef9468136aafb Mon Sep 17 00:00:00 2001 From: Vasily Date: Sat, 20 Apr 2019 21:39:09 +0200 Subject: [PATCH] Add noX11 flag to Linux compilations This allows users that are not using X11 to still compile the application. --- build_scripts/linux/build_linux.sh | 2 +- build_scripts/linux/configure.sh | 3 +++ build_scripts/qt/sources.pri | 11 ++++++++--- docs/building_for_linux.md | 1 + 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/build_scripts/linux/build_linux.sh b/build_scripts/linux/build_linux.sh index fa8e7bc..b369e4c 100755 --- a/build_scripts/linux/build_linux.sh +++ b/build_scripts/linux/build_linux.sh @@ -9,7 +9,7 @@ echo $MAKE_COMMAND mkdir -p $BUILD_DIR cd $BUILD_DIR qmake --version -qmake -spec $QMAKE_SPEC $PROJECT_DIR +qmake -spec $QMAKE_SPEC $PROJECT_DIR $QMAKE_EXTRAS $MAKE_COMMAND $CLANG_TIDY cp -r $PROJECT_DIR/src/res $BUILD_DIR/bin/linux/AdvancedSettings/ diff --git a/build_scripts/linux/configure.sh b/build_scripts/linux/configure.sh index 7ffdac5..6e8e9f6 100644 --- a/build_scripts/linux/configure.sh +++ b/build_scripts/linux/configure.sh @@ -18,3 +18,6 @@ else CLANG_TIDY="$SCRIPT_DIR/run-clang-tidy.sh" fi +if [[ -n $NO_X11 ]]; then + QMAKE_EXTRAS='CONFIG+=noX11' +fi diff --git a/build_scripts/qt/sources.pri b/build_scripts/qt/sources.pri index 0fcc1d9..bed2abb 100644 --- a/build_scripts/qt/sources.pri +++ b/build_scripts/qt/sources.pri @@ -54,9 +54,14 @@ win32 { } unix:!macx { - SOURCES += src/tabcontrollers/keyboardinput/KeyboardInputX11.cpp - CONFIG += x11 - LIBS += -lXtst + !noX11 { + SOURCES += src/tabcontrollers/keyboardinput/KeyboardInputX11.cpp + CONFIG += x11 + LIBS += -lXtst + } + else { + SOURCES += src/tabcontrollers/keyboardinput/KeyboardInputDummy.cpp + } } macx { diff --git a/docs/building_for_linux.md b/docs/building_for_linux.md index e78286e..24ed7c5 100644 --- a/docs/building_for_linux.md +++ b/docs/building_for_linux.md @@ -143,6 +143,7 @@ The following environmental variables are relevant for building the project. | -------------------- | ------------- | | `QMAKE_SPEC` | The [mkspec](https://forum.qt.io/topic/70970/what-is-mkspecs-used-for-how-to-configure-for-my-hardware) to compile to. Either `linux-g++` or `linux-clang`. Defaults to `linux-g++`. | | `USE_TIDY` | If set a compilation database will be created and the project linted. Can only be used with `clang`. | +| `NO_X11` | If set the application will be compiled without X11 specific libraries. This disables certain things like sending keystrokes from VR. | If an environment variable isn't set a default value will be provided. The default values are shown in the table below.