From 450063656af4b787b5856df686213f36ae27ab13 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 7 Jan 2015 19:46:30 +0000 Subject: [PATCH] Pass the correct command line for enabling C++11 on newer gcc compilers. --- leocad.pro | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/leocad.pro b/leocad.pro index 3c8aa37d..2b0f0cdc 100644 --- a/leocad.pro +++ b/leocad.pro @@ -19,8 +19,18 @@ win32 { LIBS += -ladvapi32 -lshell32 } else { LIBS += -lz - QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter - QMAKE_CXXFLAGS += -std=c++0x + QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter +} + +lessThan(QT_MAJOR_VERSION, 5) { + unix { + GCC_VERSION = $$system(g++ -dumpversion) + greaterThan(GCC_VERSION, 4.6) { + QMAKE_CXXFLAGS += -std=c++11 + } else { + QMAKE_CXXFLAGS += -std=c++0x + } + } } isEmpty(QMAKE_LRELEASE) {