From 0ef66e98ccf4946a0e4513ab5fc157df0f0aca4e Mon Sep 17 00:00:00 2001 From: Thomas Miller Date: Tue, 24 Jul 2018 14:52:04 -0700 Subject: [PATCH] Fix qtbase build for MSVC 2017 15.8 Fixed breaks caused by MSVC 2017 15.8 fixing std::aligned_storage. Change-Id: I5adea18c184e34bbdc3bd294d034b97383ef08a3 Reviewed-by: Thiago Macieira --- mkspecs/common/msvc-version.conf | 6 ++++++ qmake/Makefile.win32 | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mkspecs/common/msvc-version.conf b/mkspecs/common/msvc-version.conf index 3fb55c9d81..5805383a04 100644 --- a/mkspecs/common/msvc-version.conf +++ b/mkspecs/common/msvc-version.conf @@ -110,6 +110,12 @@ greaterThan(QMAKE_MSC_VER, 1909) { QMAKE_CXXFLAGS_CXX14 = -std:c++14 QMAKE_CXXFLAGS_CXX1Z = -std:c++17 } + + # MSVC 2017 15.8+ fixed std::aligned_storage but compilation fails without + # this flag since the fix breaks binary compatibility. + greaterThan(QMAKE_MSC_VER, 1914) { + DEFINES += _ENABLE_EXTENDED_ALIGNED_STORAGE + } } greaterThan(QMAKE_MSC_VER, 1910) { diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 3abcc1f21c..5292332187 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -39,7 +39,7 @@ CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \ -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS \ -DQT_VERSION_STR=\"$(QT_VERSION)\" -DQT_VERSION_MAJOR=$(QT_MAJOR_VERSION) -DQT_VERSION_MINOR=$(QT_MINOR_VERSION) -DQT_VERSION_PATCH=$(QT_PATCH_VERSION) \ -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \ - -DQT_NO_FOREACH -DUNICODE + -DQT_NO_FOREACH -DUNICODE -D_ENABLE_EXTENDED_ALIGNED_STORAGE CFLAGS = $(CFLAGS_PCH) $(CFLAGS_BARE) $(CFLAGS) CXXFLAGS_BARE = $(CFLAGS_BARE)