VS2010: Disable PDBs when there is no debug info
When none of the options /Z7, /Zi and /ZI are specified in the cmake project settings, the project will open in the editor with "Program Database" as the default debug information format, ending up always generating PDBs regardless of project configuration. Modify the output project file so that if the debug information format is not specified in the cmake project settings it will default to no PDB generated, just like all the previous other Visual Studio versions. This problem comes from the fact that Microsoft changed the default setting of the debug information format to be "Program Database" instead of "Disabled".
This commit is contained in:
parent
b29cd51147
commit
e234122693
|
@ -1033,6 +1033,15 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
|
||||||
clOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
|
clOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
|
||||||
this->OutputIncludes(includes);
|
this->OutputIncludes(includes);
|
||||||
clOptions.OutputFlagMap(*this->BuildFileStream, " ");
|
clOptions.OutputFlagMap(*this->BuildFileStream, " ");
|
||||||
|
|
||||||
|
// If not in debug mode, write the DebugInformationFormat field
|
||||||
|
// without value so PDBs don't get generated uselessly.
|
||||||
|
if(!clOptions.IsDebug())
|
||||||
|
{
|
||||||
|
this->WriteString("<DebugInformationFormat>"
|
||||||
|
"</DebugInformationFormat>\n", 3);
|
||||||
|
}
|
||||||
|
|
||||||
clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
|
clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
|
||||||
"\n");
|
"\n");
|
||||||
this->WriteString("<AssemblerListingLocation>", 3);
|
this->WriteString("<AssemblerListingLocation>", 3);
|
||||||
|
|
Loading…
Reference in New Issue