From 87bb9e28cd3719561b199a999573db6063d9e3c6 Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Mon, 29 Jan 2018 07:49:42 +0000 Subject: [PATCH] Fix MinGW build without any optimizations Building without any optimizations disabled implicit inlining of MetaClass::getMemberList() and we ended up with many undefined symbols. --- mkspecs/features/common_pre.prf | 7 ++++++- src/blackmisc/metaclass.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/common_pre.prf b/mkspecs/features/common_pre.prf index e2dc89032..abfa3753b 100644 --- a/mkspecs/features/common_pre.prf +++ b/mkspecs/features/common_pre.prf @@ -74,7 +74,12 @@ msvc:!llvm: QMAKE_CXXFLAGS *= /bigobj # No gigantic MinGW obj files ################################ -win32-g++: QMAKE_CXXFLAGS_DEBUG += -Og +# If you get variables, optimized out during debugging, try to comment the first and uncomment +# the second line. This disables all debug optimizations. But be warned, that the build +# will take hours. + +win32-g++: CONFIG += optimize_debug +# win32-g++: QMAKE_CXXFLAGS *= -Wa,-mbig-obj ################################ # FSX or FS9 on 32bit Windows only diff --git a/src/blackmisc/metaclass.h b/src/blackmisc/metaclass.h index 8a49a39f7..0d6a6bb60 100644 --- a/src/blackmisc/metaclass.h +++ b/src/blackmisc/metaclass.h @@ -28,7 +28,7 @@ // Work around MinGW problem with combination of constexpr and extern template #if defined(Q_OS_WIN) && defined(Q_CC_GNU) -#define BLACK_NO_EXPORT_CONSTEXPR constexpr inline __attribute__((gnu_inline)) +#define BLACK_NO_EXPORT_CONSTEXPR constexpr inline __attribute__((always_inline)) #else #define BLACK_NO_EXPORT_CONSTEXPR constexpr #endif