diff --git a/Jamulus.pro b/Jamulus.pro index b9fbd0dd..6cc6f0a4 100755 --- a/Jamulus.pro +++ b/Jamulus.pro @@ -13,10 +13,10 @@ CONFIG += qt \ QT += network \ xml -!contains(CONFIG, "headless") { - QT += widgets -} else { +contains(CONFIG, "headless") { QT -= gui +} else { + QT += widgets } TRANSLATIONS = src/res/translation/translation_de_DE.ts \ @@ -992,12 +992,12 @@ DISTFILES_OPUS += libs/opus/AUTHORS \ libs/opus/celt/arm/armopts.s.in \ libs/opus/celt/arm/celt_pitch_xcorr_arm.s \ -!contains(CONFIG, "headless") { +contains(CONFIG, "headless") { + DEFINES += HEADLESS +} else { HEADERS += $$HEADERS_GUI SOURCES += $$SOURCES_GUI FORMS += $$FORMS_GUI -} else { - DEFINES += HEADLESS } # use external OPUS library if requested diff --git a/src/main.cpp b/src/main.cpp index 801be8e8..9a19c85f 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -503,7 +503,7 @@ int main ( int argc, char** argv ) } #ifdef HEADLESS - if (bUseGUI) + if ( bUseGUI ) { bUseGUI = false; tsConsole << "No GUI support compiled. Running in headless mode." << endl; @@ -538,8 +538,8 @@ int main ( int argc, char** argv ) QCoreApplication* pApp = new QCoreApplication ( argc, argv ); #else QCoreApplication* pApp = bUseGUI - ? new QApplication ( argc, argv ) - : new QCoreApplication ( argc, argv ); + ? new QApplication ( argc, argv ) + : new QCoreApplication ( argc, argv ); #endif #ifdef ANDROID @@ -662,6 +662,7 @@ int main ( int argc, char** argv ) bDisconnectAllClientsOnQuit, bUseDoubleSystemFrameSize, eLicenceType ); + #ifndef HEADLESS if ( bUseGUI ) { diff --git a/src/soundbase.cpp b/src/soundbase.cpp index 7d5adb4a..5e8a9702 100755 --- a/src/soundbase.cpp +++ b/src/soundbase.cpp @@ -22,10 +22,6 @@ * \******************************************************************************/ -#ifndef HEADLESS -# include -#endif - #include "soundbase.h" diff --git a/src/soundbase.h b/src/soundbase.h index fbd5883a..ab588a46 100755 --- a/src/soundbase.h +++ b/src/soundbase.h @@ -26,6 +26,9 @@ #include #include +#ifndef HEADLESS +# include +#endif #include "global.h" #include "util.h"