Added new config "libretroshare_shared" to build libretroshare as shared library (default off) based on changes from ET. Activated for Windows build with plugins to fix the link error (ld.exe: Error: export ordinal too large) due to too many exported symbols.

This commit is contained in:
thunder2 2020-11-09 16:30:28 +01:00
parent 1895abfb24
commit 76b22ada5c
5 changed files with 17 additions and 4 deletions

View File

@ -4,7 +4,11 @@
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
TEMPLATE = lib
libretroshare_shared {
CONFIG += shared
} else {
CONFIG += staticlib
}
CONFIG -= qt
TARGET = retroshare
TARGET_PRL = libretroshare
@ -242,7 +246,7 @@ win32-g++|win32-clang-g++ {
QMAKE_CC = $${QMAKE_CXX}
OBJECTS_DIR = temp/obj
MOC_DIR = temp/moc
DEFINES *= STATICLIB
!libretroshare_shared:DEFINES *= STATICLIB
# Switch on extra warnings
QMAKE_CFLAGS += -Wextra

View File

@ -6,10 +6,10 @@ RS_BUILD_PATH=$$clean_path($${OUT_PWD}/../../)
DEPENDPATH *= $$clean_path($${RS_SRC_PATH}/libretroshare/src/)
INCLUDEPATH *= $$clean_path($${RS_SRC_PATH}/libretroshare/src)
LIBS *= -L$$clean_path($${RS_BUILD_PATH}/libretroshare/src/lib/) -lretroshare
equals(TARGET, retroshare):equals(TEMPLATE, lib){
} else {
LIBS *= -L$$clean_path($${RS_BUILD_PATH}/libretroshare/src/lib/) -lretroshare
PRE_TARGETDEPS *= $$clean_path($${RS_BUILD_PATH}/libretroshare/src/lib/libretroshare.a)
}

View File

@ -42,6 +42,11 @@ win32 {
QMAKE_LFLAGS = -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
}
libretroshare_shared {
PRE_TARGETDEPS += $$OUT_PWD/../../libretroshare/src/lib/libretroshare.a
LIBS += -L"$$OUT_PWD/../../libretroshare/src/lib" -lretroshare
}
# Switch on extra warnings
QMAKE_CFLAGS += -Wextra
QMAKE_CXXFLAGS += -Wextra

View File

@ -232,7 +232,7 @@ win32-g++|win32-clang-g++ {
# Fix linking error (ld.exe: Error: export ordinal too large) due to too
# many exported symbols.
QMAKE_LFLAGS+=-Wl,--exclude-libs,ALL
!libretroshare_shared:QMAKE_LFLAGS+=-Wl,--exclude-libs,ALL
# Switch off optimization for release version
QMAKE_CXXFLAGS_RELEASE -= -O2

View File

@ -204,6 +204,10 @@ no_rs_service_terminal_login:CONFIG -= rs_service_terminal_login
CONFIG+=rs_dh_init_check
no_rs_dh_init_check:CONFIG -= rs_dh_init_check
# To export all symbols for the plugins on Windows build we need to build libretroshare as
# shared library. Fix linking error (ld.exe: Error: export ordinal too large) due to too
# many exported symbols.
retroshare_plugins:win32:CONFIG *= libretroshare_shared
# Specify host precompiled jsonapi-generator path, appending the following
# assignation to qmake command line