Multiple improvements to build process

Restructure and document retroshare.pri variables and helper functions
Link sqlite statically like other libraries on Android
qmake has multiple win32-* specs match them correctly
Move a buch of generic thing to retroshare.pri instead of having them replocated
  accross project specific .pro
Fix retroshare-gui too many symbols exported on windows liking error by adding
  QMAKE_LFLAGS+=-Wl,--exclude-libs,ALL
Rename retroshare-gui/src/util/win32.h because the name is too prone to
  confusion and build conflicts
libreasapi avoid usage of cretar_prl link_prl that seems unreliable on some
  platforms
libreasapi rename LIBRESAPI_QT to more understendable LIBRESAPI_SETTINGS
Use use_*.pri instead of copy pasting error prone qmake snippets around
Expose bitdht option to retroshare.pri
Add RS_THREAD_LIB qmake variable for better crossplatform support
Move debug and profiling generic options to retroshare.pri (avoid copy/pasting)
Remove Qt script module in qmake as it is not available anymore
This commit is contained in:
Gioacchino Mazzurco 2018-04-15 13:41:52 +02:00
parent b36cb1ef17
commit 4876a0ea3b
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
21 changed files with 502 additions and 466 deletions

View file

@ -17,7 +17,7 @@
#include "ChannelsHandler.h"
#include "StatsHandler.h"
#ifdef LIBRESAPI_QT
#ifdef LIBRESAPI_SETTINGS
#include "SettingsHandler.h"
#endif
@ -242,7 +242,7 @@ public:
mApiPluginHandler(sts, ifaces),
mChannelsHandler(ifaces.mGxsChannels),
mStatsHandler()
#ifdef LIBRESAPI_QT
#ifdef LIBRESAPI_SETTINGS
,mSettingsHandler(sts)
#endif
{
@ -272,7 +272,7 @@ public:
&ChannelsHandler::handleRequest);
router.addResourceHandler("stats", dynamic_cast<ResourceRouter*>(&mStatsHandler),
&StatsHandler::handleRequest);
#ifdef LIBRESAPI_QT
#ifdef LIBRESAPI_SETTINGS
router.addResourceHandler("settings", dynamic_cast<ResourceRouter*>(&mSettingsHandler),
&SettingsHandler::handleRequest);
#endif
@ -290,7 +290,7 @@ public:
ChannelsHandler mChannelsHandler;
StatsHandler mStatsHandler;
#ifdef LIBRESAPI_QT
#ifdef LIBRESAPI_SETTINGS
SettingsHandler mSettingsHandler;
#endif
};

View file

@ -2,50 +2,29 @@
TEMPLATE = lib
CONFIG += staticlib
CONFIG += create_prl
CONFIG -= qt
TARGET = resapi
TARGET_PRL = libresapi
DESTDIR = lib
DEPENDPATH += ../../libretroshare/src/
INCLUDEPATH += ../../libretroshare/src
!include(use_libresapi.pri):error("Including")
libresapilocalserver {
CONFIG *= qt
QT *= network
SOURCES *= api/ApiServerLocal.cpp
HEADERS *= api/ApiServerLocal.h
}
retroshare_android_service {
win32 {
OBJECTS_DIR = temp/obj
libresapi_settings {
CONFIG *= qt
QT *= core
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"
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
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
}
}
SOURCES += api/SettingsHandler.cpp
HEADERS += api/SettingsHandler.h
}
libresapihttpserver {
CONFIG += libmicrohttpd
unix {
webui_files.path = "$${DATA_DIR}/webui"
@ -211,18 +190,3 @@ HEADERS += \
api/ChannelsHandler.h \
api/StatsHandler.h \
api/FileSharingHandler.h
libresapilocalserver {
CONFIG *= qt
QT *= network
SOURCES *= api/ApiServerLocal.cpp
HEADERS *= api/ApiServerLocal.h
}
qt_dependencies {
CONFIG *= qt
QT *= core
SOURCES += api/SettingsHandler.cpp
HEADERS += api/SettingsHandler.h
}

View file

@ -0,0 +1,27 @@
DEPENDPATH *= $$system_path($$clean_path($$PWD/../../libresapi/src))
INCLUDEPATH *= $$system_path($$clean_path($${PWD}/../../libresapi/src))
LIBS *= -L$$system_path($$clean_path($${OUT_PWD}/../../libresapi/src/lib/)) -lresapi
!equals(TARGET, resapi):PRE_TARGETDEPS *= $$system_path($$clean_path($${OUT_PWD}/../../libresapi/src/lib/libresapi.a))
!include("../../libretroshare/src/use_libretroshare.pri"):error("Including")
sLibs =
mLibs =
dLibs =
libresapihttpserver {
mLibs *= microhttpd
}
static {
sLibs *= $$mLibs
} else {
dLibs *= $$mLibs
}
LIBS += $$linkStaticLibs(sLibs)
PRE_TARGETDEPS += $$pretargetStaticLibs(sLibs)
LIBS += $$linkDynamicLibs(dLibs)