diff options
author | Robert Goulet <Robert.Goulet@autodesk.com> | 2010-08-19 09:21:54 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-08-19 09:21:54 -0400 |
commit | e2341226938857c4b32aa976587fa18cca230a1c (patch) | |
tree | df1d3a8b120938311a893dffd0433874cd37d96d /Source | |
parent | b29cd5114750b8951f1cf9991e11e86ba6bd89f1 (diff) | |
download | cmake-e2341226938857c4b32aa976587fa18cca230a1c.tar.gz |
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".
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 59e20d50c2..ca522bb32e 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1033,6 +1033,15 @@ void cmVisualStudio10TargetGenerator::WriteClOptions( clOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", ""); this->OutputIncludes(includes); 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, " ", "\n"); this->WriteString("<AssemblerListingLocation>", 3); |