From 9f54846d951838361f4188b423e7aa7c7b9a9540 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 30 Jan 2012 15:16:50 +0100 Subject: [PATCH] qmake: Work around MSVC compiler bug. Disable optimization for getProjectUUID() as it triggers ASSERT: "&other != this" at qstring.h:720 with -O2. Change-Id: I51b31d4318ba9be187c186623099171d8f48235b Reviewed-by: Thiago Macieira --- qmake/generators/win32/msvc_vcproj.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 439574fbb0..109b50fd94 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -305,6 +305,16 @@ struct VcsolutionDepend { QStringList dependencies; }; +/* Disable optimization in getProjectUUID() due to a compiler + * bug in MSVC 2010 that causes ASSERT: "&other != this" in the QString + * copy constructor for non-empty file names at: + * filename.isEmpty()?project->first("QMAKE_MAKEFILE"):filename */ + +#ifdef Q_CC_MSVC +# pragma optimize( "g", off ) +# pragma warning ( disable : 4748 ) +#endif + QUuid VcprojGenerator::getProjectUUID(const QString &filename) { bool validUUID = true; @@ -335,6 +345,10 @@ QUuid VcprojGenerator::getProjectUUID(const QString &filename) return uuid; } +#ifdef Q_CC_MSVC +# pragma optimize( "g", on ) +#endif + QUuid VcprojGenerator::increaseUUID(const QUuid &id) { QUuid result(id);