mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-23 14:41:04 -04:00
Changed: Qt dependecies are optional
This commit is contained in:
parent
4031e493fb
commit
569458a1c1
3 changed files with 48 additions and 28 deletions
|
@ -17,7 +17,9 @@
|
|||
#include "ChannelsHandler.h"
|
||||
#include "StatsHandler.h"
|
||||
|
||||
#include "SettingsHandler.h"
|
||||
#ifdef LIBRESAPI_QT
|
||||
#include "SettingsHandler.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
data types in json http://json.org/
|
||||
|
@ -238,8 +240,10 @@ public:
|
|||
mChatHandler(sts, ifaces.mNotify, ifaces.mMsgs, ifaces.mPeers, ifaces.mIdentity, &mPeersHandler),
|
||||
mApiPluginHandler(sts, ifaces),
|
||||
mChannelsHandler(ifaces.mGxsChannels),
|
||||
mStatsHandler(),
|
||||
mSettingsHandler(sts)
|
||||
mStatsHandler()
|
||||
#ifdef LIBRESAPI_QT
|
||||
,mSettingsHandler(sts)
|
||||
#endif
|
||||
{
|
||||
// the dynamic cast is to not confuse the addResourceHandler template like this:
|
||||
// addResourceHandler(derived class, parent class)
|
||||
|
@ -265,8 +269,10 @@ public:
|
|||
&ChannelsHandler::handleRequest);
|
||||
router.addResourceHandler("stats", dynamic_cast<ResourceRouter*>(&mStatsHandler),
|
||||
&StatsHandler::handleRequest);
|
||||
#ifdef LIBRESAPI_QT
|
||||
router.addResourceHandler("settings", dynamic_cast<ResourceRouter*>(&mSettingsHandler),
|
||||
&SettingsHandler::handleRequest);
|
||||
#endif
|
||||
}
|
||||
|
||||
PeersHandler mPeersHandler;
|
||||
|
@ -279,7 +285,10 @@ public:
|
|||
ApiPluginHandler mApiPluginHandler;
|
||||
ChannelsHandler mChannelsHandler;
|
||||
StatsHandler mStatsHandler;
|
||||
|
||||
#ifdef LIBRESAPI_QT
|
||||
SettingsHandler mSettingsHandler;
|
||||
#endif
|
||||
};
|
||||
|
||||
ApiServer::ApiServer():
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
TEMPLATE = lib
|
||||
CONFIG += staticlib
|
||||
CONFIG += create_prl
|
||||
CONFIG += qt
|
||||
QT += core
|
||||
CONFIG -= qt
|
||||
TARGET = resapi
|
||||
TARGET_PRL = libresapi
|
||||
DESTDIR = lib
|
||||
|
@ -13,32 +12,32 @@ INCLUDEPATH += ../../libretroshare/src
|
|||
|
||||
retroshare_android_service {
|
||||
win32 {
|
||||
OBJECTS_DIR = temp/obj
|
||||
OBJECTS_DIR = temp/obj
|
||||
|
||||
LIBS_DIR = $$PWD/../../libs/lib
|
||||
LIBS += $$OUT_PWD/../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS += $$OUT_PWD/../../openpgpsdk/src/lib/libops.a
|
||||
LIBS_DIR = $$PWD/../../libs/lib
|
||||
LIBS += $$OUT_PWD/../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS += $$OUT_PWD/../../openpgpsdk/src/lib/libops.a
|
||||
|
||||
for(lib, LIB_DIR):LIBS += -L"$$lib"
|
||||
for(bin, BIN_DIR):LIBS += -L"$$bin"
|
||||
for(lib, LIB_DIR):LIBS += -L"$$lib"
|
||||
for(bin, BIN_DIR):LIBS += -L"$$bin"
|
||||
|
||||
|
||||
LIBS += -lssl -lcrypto -lpthread -lminiupnpc -lz -lws2_32
|
||||
LIBS += -luuid -lole32 -liphlpapi -lcrypt32 -lgdi32
|
||||
LIBS += -lwinmm
|
||||
LIBS += -lssl -lcrypto -lpthread -lminiupnpc -lz -lws2_32
|
||||
LIBS += -luuid -lole32 -liphlpapi -lcrypt32 -lgdi32
|
||||
LIBS += -lwinmm
|
||||
|
||||
DEFINES *= WINDOWS_SYS WIN32_LEAN_AND_MEAN _USE_32BIT_TIME_T
|
||||
DEFINES *= WINDOWS_SYS WIN32_LEAN_AND_MEAN _USE_32BIT_TIME_T
|
||||
|
||||
DEPENDPATH += . $$INC_DIR
|
||||
INCLUDEPATH += . $$INC_DIR
|
||||
DEPENDPATH += . $$INC_DIR
|
||||
INCLUDEPATH += . $$INC_DIR
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
# Qt 5
|
||||
RC_INCLUDEPATH += $$_PRO_FILE_PWD_/../../libretroshare/src
|
||||
} else {
|
||||
# Qt 4
|
||||
QMAKE_RC += --include-dir=$$_PRO_FILE_PWD_/../../libretroshare/src
|
||||
}
|
||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
# Qt 5
|
||||
RC_INCLUDEPATH += $$_PRO_FILE_PWD_/../../libretroshare/src
|
||||
} else {
|
||||
# Qt 4
|
||||
QMAKE_RC += --include-dir=$$_PRO_FILE_PWD_/../../libretroshare/src
|
||||
}
|
||||
}
|
||||
|
||||
DEPENDPATH += . ../../libretroshare/src/
|
||||
|
@ -183,8 +182,7 @@ SOURCES += \
|
|||
util/ContentTypes.cpp \
|
||||
api/ApiPluginHandler.cpp \
|
||||
api/ChannelsHandler.cpp \
|
||||
api/StatsHandler.cpp \
|
||||
api/SettingsHandler.cpp
|
||||
api/StatsHandler.cpp
|
||||
|
||||
HEADERS += \
|
||||
api/ApiServer.h \
|
||||
|
@ -211,8 +209,7 @@ HEADERS += \
|
|||
util/ContentTypes.h \
|
||||
api/ApiPluginHandler.h \
|
||||
api/ChannelsHandler.h \
|
||||
api/StatsHandler.h \
|
||||
api/SettingsHandler.h
|
||||
api/StatsHandler.h
|
||||
|
||||
libresapilocalserver {
|
||||
CONFIG *= qt
|
||||
|
@ -220,3 +217,11 @@ libresapilocalserver {
|
|||
SOURCES *= api/ApiServerLocal.cpp
|
||||
HEADERS *= api/ApiServerLocal.h
|
||||
}
|
||||
|
||||
qt_dependencies {
|
||||
CONFIG *= qt
|
||||
QT *= core
|
||||
|
||||
SOURCES += api/SettingsHandler.cpp
|
||||
HEADERS += api/SettingsHandler.h
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue