diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index dfc88de8f..84d18944e 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -4,7 +4,11 @@ !include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri") TEMPLATE = lib -CONFIG += staticlib +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 diff --git a/libretroshare/src/use_libretroshare.pri b/libretroshare/src/use_libretroshare.pri index 5f291b29c..b287a6591 100644 --- a/libretroshare/src/use_libretroshare.pri +++ b/libretroshare/src/use_libretroshare.pri @@ -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) } diff --git a/plugins/Common/retroshare_plugin.pri b/plugins/Common/retroshare_plugin.pri index eb6b10574..8ed4553e1 100644 --- a/plugins/Common/retroshare_plugin.pri +++ b/plugins/Common/retroshare_plugin.pri @@ -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 diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index 960666d4e..2bb9e16b9 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -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 diff --git a/retroshare.pri b/retroshare.pri index 500300cfd..963a65ed2 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -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