2018-11-04 15:48:33 +01:00
|
|
|
################################################################################
|
|
|
|
# retroshare_plugin.pri #
|
|
|
|
# Copyright (C) 2018, Retroshare team <retroshare.team@gmailcom> #
|
|
|
|
# #
|
|
|
|
# This program is free software: you can redistribute it and/or modify #
|
|
|
|
# it under the terms of the GNU Affero General Public License as #
|
|
|
|
# published by the Free Software Foundation, either version 3 of the #
|
|
|
|
# License, or (at your option) any later version. #
|
|
|
|
# #
|
|
|
|
# This program is distributed in the hope that it will be useful, #
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
|
|
|
# GNU Lesser General Public License for more details. #
|
|
|
|
# #
|
|
|
|
# You should have received a copy of the GNU Lesser General Public License #
|
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
|
|
|
|
################################################################################
|
|
|
|
|
2015-08-31 17:55:30 +02:00
|
|
|
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
|
|
|
|
|
2011-06-17 07:13:47 +00:00
|
|
|
TEMPLATE = lib
|
2015-08-29 11:40:50 +02:00
|
|
|
CONFIG *= plugin
|
2011-06-17 18:55:59 +00:00
|
|
|
|
2016-09-05 14:03:39 +02:00
|
|
|
DEPENDPATH += $$PWD/../../libretroshare/src/ $$PWD/../../retroshare-gui/src/
|
|
|
|
INCLUDEPATH += $$PWD/../../libretroshare/src/ $$PWD/../../retroshare-gui/src/
|
2011-06-17 07:13:47 +00:00
|
|
|
|
2018-12-21 15:50:45 +01:00
|
|
|
linux-* {
|
2018-12-21 16:37:02 +01:00
|
|
|
target.path = "$${RS_PLUGIN_DIR}"
|
2015-08-22 20:50:30 +02:00
|
|
|
INSTALLS += target
|
|
|
|
}
|
|
|
|
|
2011-06-17 07:13:47 +00:00
|
|
|
linux-g++ {
|
2011-06-17 18:55:59 +00:00
|
|
|
LIBS *= -ldl
|
|
|
|
}
|
|
|
|
linux-g++-64 {
|
2011-06-17 07:13:47 +00:00
|
|
|
LIBS *= -ldl
|
|
|
|
}
|
|
|
|
|
2011-10-08 17:47:36 +00:00
|
|
|
win32 {
|
2013-10-20 00:56:34 +00:00
|
|
|
lessThan(QT_MAJOR_VERSION, 5) {
|
|
|
|
# from Qt 4.7.4 and 4.8+ the mkspecs has changed making dyn libs unusable anymore on windows : QMAKE_LFLAGS =
|
2014-06-21 21:12:27 +00:00
|
|
|
QMAKE_LFLAGS = -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
|
2013-10-20 00:56:34 +00:00
|
|
|
}
|
2012-09-10 22:23:54 +00:00
|
|
|
|
2020-11-09 16:30:28 +01:00
|
|
|
libretroshare_shared {
|
2020-11-23 18:18:40 +01:00
|
|
|
win32-g++|win32-clang-g++:!isEmpty(QMAKE_SH) {
|
|
|
|
# Windows msys2
|
|
|
|
LIBRETROSHARE_TARGET=libretroshare.dll.a
|
|
|
|
} else {
|
|
|
|
LIBRETROSHARE_TARGET=libretroshare.a
|
|
|
|
}
|
|
|
|
PRE_TARGETDEPS += $$OUT_PWD/../../libretroshare/src/lib/$${LIBRETROSHARE_TARGET}
|
2020-11-09 16:30:28 +01:00
|
|
|
LIBS += -L"$$OUT_PWD/../../libretroshare/src/lib" -lretroshare
|
|
|
|
}
|
|
|
|
|
2016-01-28 16:20:11 +01:00
|
|
|
CONFIG(debug, debug|release) {
|
|
|
|
} else {
|
|
|
|
# Tell linker to use ASLR protection
|
|
|
|
QMAKE_LFLAGS += -Wl,-dynamicbase
|
|
|
|
# Tell linker to use DEP protection
|
|
|
|
QMAKE_LFLAGS += -Wl,-nxcompat
|
|
|
|
}
|
|
|
|
|
2015-09-03 16:24:57 +02:00
|
|
|
# solve linker warnings because of the order of the libraries
|
|
|
|
QMAKE_LFLAGS += -Wl,--start-group
|
|
|
|
|
2012-02-28 21:59:01 +00:00
|
|
|
OBJECTS_DIR = temp/obj
|
|
|
|
MOC_DIR = temp/moc
|
|
|
|
RCC_DIR = temp/qrc
|
|
|
|
UI_DIR = temp/ui
|
2011-10-08 17:47:36 +00:00
|
|
|
|
2018-10-07 13:07:22 +02:00
|
|
|
DEFINES += WINDOWS_SYS WIN32 STATICLIB MINGW WIN32_LEAN_AND_MEAN
|
2015-09-23 18:25:03 +02:00
|
|
|
#DEFINES += MINIUPNPC_VERSION=13
|
2020-11-22 22:14:37 +01:00
|
|
|
DESTDIR = lib
|
2011-10-08 17:47:36 +00:00
|
|
|
|
2012-08-02 23:25:28 +00:00
|
|
|
# Switch off optimization for release version
|
|
|
|
QMAKE_CXXFLAGS_RELEASE -= -O2
|
|
|
|
QMAKE_CXXFLAGS_RELEASE += -O0
|
|
|
|
QMAKE_CFLAGS_RELEASE -= -O2
|
|
|
|
QMAKE_CFLAGS_RELEASE += -O0
|
|
|
|
|
|
|
|
# Switch on optimization for debug version
|
|
|
|
#QMAKE_CXXFLAGS_DEBUG += -O2
|
|
|
|
#QMAKE_CFLAGS_DEBUG += -O2
|
|
|
|
|
2012-02-28 21:59:01 +00:00
|
|
|
DEFINES += USE_CMD_ARGS
|
2011-10-08 17:47:36 +00:00
|
|
|
|
2012-02-28 21:59:01 +00:00
|
|
|
#miniupnp implementation files
|
2015-09-23 18:25:03 +02:00
|
|
|
#HEADERS += upnp/upnputil.h
|
|
|
|
#SOURCES += upnp/upnputil.c
|
2011-10-08 17:47:36 +00:00
|
|
|
|
2015-09-23 18:25:03 +02:00
|
|
|
DEPENDPATH += . $$INC_DIR
|
|
|
|
INCLUDEPATH += . $$INC_DIR
|
2011-10-08 17:47:36 +00:00
|
|
|
|
2016-09-05 14:03:39 +02:00
|
|
|
PRE_TARGETDEPS += $$OUT_PWD/../../retroshare-gui/src/lib/libretroshare-gui.a
|
|
|
|
LIBS += -L"$$OUT_PWD/../../retroshare-gui/src/lib" -lretroshare-gui
|
2011-10-08 17:47:36 +00:00
|
|
|
|
2015-09-23 18:25:03 +02:00
|
|
|
for(lib, LIB_DIR):LIBS += -L"$$lib"
|
|
|
|
for(bin, BIN_DIR):LIBS += -L"$$bin"
|
2013-12-28 23:49:50 +00:00
|
|
|
LIBS += -lpthread
|
2021-11-05 21:18:26 +01:00
|
|
|
|
|
|
|
# Do not add for MinGW
|
|
|
|
!isEmpty(QMAKE_SH): QMAKE_LFLAGS += -Wl,--end-group
|
2011-10-08 17:47:36 +00:00
|
|
|
}
|
2015-12-24 18:54:45 +01:00
|
|
|
|
|
|
|
macx {
|
2016-01-02 14:19:53 +01:00
|
|
|
#You can found some information here:
|
|
|
|
#https://developer.apple.com/library/mac/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html
|
|
|
|
QMAKE_LFLAGS_PLUGIN -= -dynamiclib
|
|
|
|
QMAKE_LFLAGS_PLUGIN += -bundle
|
2017-07-17 10:44:27 +02:00
|
|
|
QMAKE_LFLAGS_PLUGIN += -bundle_loader "../../retroshare-gui/src/retroshare.app/Contents/MacOS/retroshare"
|
2015-12-24 18:54:45 +01:00
|
|
|
|
|
|
|
OBJECTS_DIR = temp/obj
|
|
|
|
MOC_DIR = temp/moc
|
|
|
|
RCC_DIR = temp/qrc
|
|
|
|
UI_DIR = temp/ui
|
|
|
|
|
|
|
|
DEPENDPATH += . $$INC_DIR
|
|
|
|
INCLUDEPATH += . $$INC_DIR
|
|
|
|
|
|
|
|
for(lib, LIB_DIR):LIBS += -L"$$lib"
|
|
|
|
for(bin, BIN_DIR):LIBS += -L"$$bin"
|
|
|
|
}
|