mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-12 07:59:29 -05:00
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:
parent
1895abfb24
commit
76b22ada5c
@ -4,7 +4,11 @@
|
|||||||
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
|
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
|
||||||
|
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
|
libretroshare_shared {
|
||||||
|
CONFIG += shared
|
||||||
|
} else {
|
||||||
CONFIG += staticlib
|
CONFIG += staticlib
|
||||||
|
}
|
||||||
CONFIG -= qt
|
CONFIG -= qt
|
||||||
TARGET = retroshare
|
TARGET = retroshare
|
||||||
TARGET_PRL = libretroshare
|
TARGET_PRL = libretroshare
|
||||||
@ -242,7 +246,7 @@ win32-g++|win32-clang-g++ {
|
|||||||
QMAKE_CC = $${QMAKE_CXX}
|
QMAKE_CC = $${QMAKE_CXX}
|
||||||
OBJECTS_DIR = temp/obj
|
OBJECTS_DIR = temp/obj
|
||||||
MOC_DIR = temp/moc
|
MOC_DIR = temp/moc
|
||||||
DEFINES *= STATICLIB
|
!libretroshare_shared:DEFINES *= STATICLIB
|
||||||
|
|
||||||
# Switch on extra warnings
|
# Switch on extra warnings
|
||||||
QMAKE_CFLAGS += -Wextra
|
QMAKE_CFLAGS += -Wextra
|
||||||
|
@ -6,10 +6,10 @@ RS_BUILD_PATH=$$clean_path($${OUT_PWD}/../../)
|
|||||||
|
|
||||||
DEPENDPATH *= $$clean_path($${RS_SRC_PATH}/libretroshare/src/)
|
DEPENDPATH *= $$clean_path($${RS_SRC_PATH}/libretroshare/src/)
|
||||||
INCLUDEPATH *= $$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){
|
equals(TARGET, retroshare):equals(TEMPLATE, lib){
|
||||||
} else {
|
} else {
|
||||||
|
LIBS *= -L$$clean_path($${RS_BUILD_PATH}/libretroshare/src/lib/) -lretroshare
|
||||||
PRE_TARGETDEPS *= $$clean_path($${RS_BUILD_PATH}/libretroshare/src/lib/libretroshare.a)
|
PRE_TARGETDEPS *= $$clean_path($${RS_BUILD_PATH}/libretroshare/src/lib/libretroshare.a)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +42,11 @@ win32 {
|
|||||||
QMAKE_LFLAGS = -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
|
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
|
# Switch on extra warnings
|
||||||
QMAKE_CFLAGS += -Wextra
|
QMAKE_CFLAGS += -Wextra
|
||||||
QMAKE_CXXFLAGS += -Wextra
|
QMAKE_CXXFLAGS += -Wextra
|
||||||
|
@ -232,7 +232,7 @@ win32-g++|win32-clang-g++ {
|
|||||||
|
|
||||||
# Fix linking error (ld.exe: Error: export ordinal too large) due to too
|
# Fix linking error (ld.exe: Error: export ordinal too large) due to too
|
||||||
# many exported symbols.
|
# many exported symbols.
|
||||||
QMAKE_LFLAGS+=-Wl,--exclude-libs,ALL
|
!libretroshare_shared:QMAKE_LFLAGS+=-Wl,--exclude-libs,ALL
|
||||||
|
|
||||||
# Switch off optimization for release version
|
# Switch off optimization for release version
|
||||||
QMAKE_CXXFLAGS_RELEASE -= -O2
|
QMAKE_CXXFLAGS_RELEASE -= -O2
|
||||||
|
@ -204,6 +204,10 @@ no_rs_service_terminal_login:CONFIG -= rs_service_terminal_login
|
|||||||
CONFIG+=rs_dh_init_check
|
CONFIG+=rs_dh_init_check
|
||||||
no_rs_dh_init_check: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
|
# Specify host precompiled jsonapi-generator path, appending the following
|
||||||
# assignation to qmake command line
|
# assignation to qmake command line
|
||||||
|
Loading…
Reference in New Issue
Block a user