From 9cfaf68a92026303df2dea4e44f1b855dee9fad5 Mon Sep 17 00:00:00 2001 From: Vasily Date: Sat, 20 Apr 2019 16:32:08 +0200 Subject: [PATCH] Update GCC compiler to not use hardcoded g++-7 Newer versions of Ubuntu ship with >g++-7, so there will be less of a need as time goes on to perform this hack. --- build_scripts/qt/compilers/gcc.pri | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/build_scripts/qt/compilers/gcc.pri b/build_scripts/qt/compilers/gcc.pri index 70fada3..e98d549 100644 --- a/build_scripts/qt/compilers/gcc.pri +++ b/build_scripts/qt/compilers/gcc.pri @@ -1,5 +1,15 @@ -#g++-7 is needed for C++17 features. travis does not supply this by default. -QMAKE_CXX = g++-7 + +# Makes sure the "g++" command used to invoke the compilation is abvove version 7. +# If it's at or above version 7 then we can use the default g++, otherwise we'll +# specifically need g++-7. +system( g++ --version | grep -e " [0-9]\?[0-9]\?[6-9].[0-9]" ) { + message('g++' version is not above 7. Manually using 'g++-7'.) + !system(g++-7 --version) { + error(At least g++-7 required.) + } + #g++-7 is needed for C++17 features. travis does not supply this by default. + QMAKE_CXX = g++-7 +} include(clang-gcc-common-switches.pri)