From 39cb9ac873cc9b6f829238142c1efa11f6a51fda Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 23 Aug 2018 13:16:15 +0200 Subject: [PATCH] Fix qtbase build for clang-cl with MSVC 2017 15.8 Move the definition of _ENABLE_EXTENDED_ALIGNED_STORAGE to msvc-desktop.conf so that it becomes effective for all compilers using MSVC (icc, clang-cl). Task-number: QTBUG-50804 Change-Id: I5ff612cc0f5a712b855925f9bcf645e578e80504 Reviewed-by: Thiago Macieira --- mkspecs/common/msvc-desktop.conf | 4 +++- mkspecs/common/msvc-version.conf | 6 ------ mkspecs/win32-icc/qmake.conf | 1 - 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf index b7d2eecc820..a4fadeb0294 100644 --- a/mkspecs/common/msvc-desktop.conf +++ b/mkspecs/common/msvc-desktop.conf @@ -16,7 +16,9 @@ MAKEFILE_GENERATOR = MSVC.NET QMAKE_PLATFORM = win32 QMAKE_COMPILER = msvc CONFIG += flat debug_and_release debug_and_release_target precompile_header autogen_precompile_source embed_manifest_dll embed_manifest_exe -DEFINES += UNICODE _UNICODE WIN32 +# MSVC 2017 15.8+ fixed std::aligned_storage but compilation fails without +# _ENABLE_EXTENDED_ALIGNED_STORAGE flag since the fix breaks binary compatibility. +DEFINES += UNICODE _UNICODE WIN32 _ENABLE_EXTENDED_ALIGNED_STORAGE QMAKE_COMPILER_DEFINES += _WIN32 contains(QMAKE_TARGET.arch, x86_64) { DEFINES += WIN64 diff --git a/mkspecs/common/msvc-version.conf b/mkspecs/common/msvc-version.conf index 5805383a042..3fb55c9d816 100644 --- a/mkspecs/common/msvc-version.conf +++ b/mkspecs/common/msvc-version.conf @@ -110,12 +110,6 @@ 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/mkspecs/win32-icc/qmake.conf b/mkspecs/win32-icc/qmake.conf index 2447c712b19..3cb0d58824f 100644 --- a/mkspecs/win32-icc/qmake.conf +++ b/mkspecs/win32-icc/qmake.conf @@ -12,7 +12,6 @@ include(../common/msvc-desktop.conf) # modifications to msvc-desktop.conf QMAKE_COMPILER += intel_icl -DEFINES += _ENABLE_EXTENDED_ALIGNED_STORAGE QMAKE_CFLAGS_OPTIMIZE_FULL = -O3