From 26c33dc892c9e9e95f52d0bd1bd834667df0dc3d Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 21 Jan 2014 18:40:43 +0100 Subject: set empty PDB file name in release config of VS 2012 vcxproj files In release configs qmake sets DebugInformationFormat to None. If ProgramDataBaseFileName is left unset, then VS 2012 will always rebuild the complete project. Therefore, qmake now inserts an empty ProgramDataBaseFileName tag if DebugInformationFormat is None. Task-number: QTBUG-35570 Change-Id: Ifb91b0bbcf6614621bfe3b12429e2624bd16e77a Reviewed-by: Oswald Buddenhagen Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msbuild_objectmodel.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 3ec70c1f58..fdb664f3f4 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -1384,6 +1384,17 @@ static inline triState toTriState(termSvrAwarenessType option) return unset; } +static XmlOutput::xml_output fixedProgramDataBaseFileNameOutput(const VCCLCompilerTool &tool) +{ + if (tool.config->CompilerVersion >= NET2012 + && tool.DebugInformationFormat == debugDisabled + && tool.ProgramDataBaseFileName.isEmpty()) { + // Force the creation of an empty tag to work-around Visual Studio bug. See QTBUG-35570. + return tagValue(_ProgramDataBaseFileName, tool.ProgramDataBaseFileName); + } + return attrTagS(_ProgramDataBaseFileName, tool.ProgramDataBaseFileName); +} + void VCXProjectWriter::write(XmlOutput &xml, const VCCLCompilerTool &tool) { xml @@ -1440,7 +1451,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCCLCompilerTool &tool) << attrTagS(_PreprocessOutputPath, tool.PreprocessOutputPath) << attrTagT(_PreprocessSuppressLineNumbers, tool.PreprocessSuppressLineNumbers) << attrTagT(_PreprocessToFile, toTriState(tool.GeneratePreprocessedFile)) - << attrTagS(_ProgramDataBaseFileName, tool.ProgramDataBaseFileName) + << fixedProgramDataBaseFileNameOutput(tool) << attrTagS(_ProcessorNumber, tool.MultiProcessorCompilationProcessorCount) << attrTagS(_RuntimeLibrary, toString(tool.RuntimeLibrary)) << attrTagT(_RuntimeTypeInfo, tool.RuntimeTypeInfo) -- cgit v1.2.3