From 2e1e227b4cfe6f26cc49e5707a9b859a1973f4fb Mon Sep 17 00:00:00 2001 From: xiphon Date: Mon, 4 Nov 2019 13:21:27 +0000 Subject: [PATCH] build: MinGW fix gcc >= 9.1 build, enable stack protection --- monero-wallet-gui.pro | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/monero-wallet-gui.pro b/monero-wallet-gui.pro index 1d58ce98..11d57bc8 100644 --- a/monero-wallet-gui.pro +++ b/monero-wallet-gui.pro @@ -16,10 +16,21 @@ packagesExist(libusb-1.0) { packagesExist(hidapi-libusb) { PKGCONFIG += hidapi-libusb } -!win32 { + +GCC_VERSION = $$system("g++ -dumpversion") +GCC_VERSION = $$split(GCC_VERSION, .) +GCC_VERSION_MAJOR = $$member(GCC_VERSION, 0) +GCC_VERSION_MINOR = $$member(GCC_VERSION, 1) +greaterThan(GCC_VERSION_MAJOR, 9) | if(equals(GCC_VERSION_MAJOR, 9) : greaterThan(GCC_VERSION_MINOR, 0)) { + GCC_9_1_OR_GREATER = TRUE +} + +!win32 | !isEmpty(GCC_9_1_OR_GREATER) { QMAKE_CXXFLAGS += -fPIC -fstack-protector -fstack-protector-strong QMAKE_LFLAGS += -fstack-protector -fstack-protector-strong +} +!win32 { packagesExist(protobuf) { PKGCONFIG += protobuf }