summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorRobert Goulet <Robert.Goulet@autodesk.com>2010-08-19 13:21:54 (GMT)
committerBrad King <brad.king@kitware.com>2010-08-19 13:21:54 (GMT)
commite2341226938857c4b32aa976587fa18cca230a1c (patch)
treedf1d3a8b120938311a893dffd0433874cd37d96d /Source/cmVisualStudio10TargetGenerator.cxx
parentb29cd5114750b8951f1cf9991e11e86ba6bd89f1 (diff)
downloadCMake-e2341226938857c4b32aa976587fa18cca230a1c.zip
CMake-e2341226938857c4b32aa976587fa18cca230a1c.tar.gz
CMake-e2341226938857c4b32aa976587fa18cca230a1c.tar.bz2
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/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 59e20d5..ca522bb 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);