summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-04-05 12:38:21 (GMT)
committerBrad King <brad.king@kitware.com>2013-04-05 15:25:09 (GMT)
commit42ba1b08f3bd5909238f7c49c31532105ef2b0e7 (patch)
tree83da13ce516022eac63e5ad94ba5f5c5bba4c8f0 /Source
parent2d8808520497aba6d82cc5ed54a715ab1d522423 (diff)
downloadCMake-42ba1b08f3bd5909238f7c49c31532105ef2b0e7.zip
CMake-42ba1b08f3bd5909238f7c49c31532105ef2b0e7.tar.gz
CMake-42ba1b08f3bd5909238f7c49c31532105ef2b0e7.tar.bz2
VS: Separate compiler and linker PDB files (#11899, #14062)
The MS tools create two types of PDB files as explained here: http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.71%29.aspx http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.80%29.aspx http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.90%29.aspx http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.100%29.aspx One is created by the compiler (/Fd) and the other by the linker (/pdb). The two options should not specify the same file. Split them up. In the VS IDE generators, simply drop ProgramDataBaseFileName to take the VS default "/Fd$(IntDir)vc$(PlatformToolsetVersion).pdb". In the Makefile generators, set "/Fd" on the compile line to be the directory containing object files (with a trailing slash the compiler will add the "vc$(PlatformToolsetVersion).pdb" filename automatically). Drop the /Fd option from the exe link command line and add "/pdb" instead (already done for dll linking). Update these rules for both MSVC and Intel tools. Drop support for PDB_OUTPUT_DIRECTORY and PDB_NAME in STATIC libraries because the generated .pdb files are only from /Fd and not real linker-generated .pdb files. Update documentation to clarify that the PDB_* properties are only for linker .pdb files. This regresses the PDBDirectoryAndName test for STATIC libraries. Since it is not clear at this time what should be done for STATIC library .pdb files, comment out the relevant portion of the test and leave a TODO comment.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmDocumentVariables.cxx2
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx10
-rw-r--r--Source/cmTarget.cxx8
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx8
4 files changed, 5 insertions, 23 deletions
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 50509a0..964ee05 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1252,7 +1252,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cm->DefineProperty
("CMAKE_PDB_OUTPUT_DIRECTORY", cmProperty::VARIABLE,
- "Where to put all the MS debug symbol files.",
+ "Where to put all the MS debug symbol files from linker.",
"This variable is used to initialize the "
"PDB_OUTPUT_DIRECTORY property on all the targets. "
"See that target property for additional information.",
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 7d0bc67..289612d 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -838,16 +838,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX");
fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\n";
fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n";
- if(targetBuilds)
- {
- // We need to specify a program database file name even for
- // non-debug configurations because VS still creates .idb files.
- fout << "\t\t\t\tProgramDataBaseFileName=\""
- << this->ConvertToXMLOutputPathSingle(
- target.GetPDBDirectory(configName).c_str())
- << "/"
- << target.GetPDBName(configName) << "\"\n";
- }
fout << "/>\n"; // end of <Tool Name=VCCLCompilerTool
tool = "VCCustomBuildTool";
if(this->FortranProject)
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 66c22b1..4c3f1f8 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -873,9 +873,9 @@ void cmTarget::DefineProperties(cmake *cm)
cm->DefineProperty
("PDB_NAME", cmProperty::TARGET,
- "Output name for MS debug symbols .pdb file.",
+ "Output name for MS debug symbols .pdb file from linker.",
"Set the base name for debug symbols file created for an "
- "executable or library target. "
+ "executable or shared library target. "
"If not set, the logical target name is used by default. "
"\n"
"This property is not implemented by the Visual Studio 6 generator.");
@@ -1384,9 +1384,9 @@ void cmTarget::DefineProperties(cmake *cm)
cm->DefineProperty
("PDB_OUTPUT_DIRECTORY", cmProperty::TARGET,
- "Output directory for MS debug symbols .pdb files.",
+ "Output directory for MS debug symbols .pdb file from linker.",
"This property specifies the directory into which the MS debug symbols "
- "will be placed. "
+ "will be placed by the linker. "
"This property is initialized by the value of the variable "
"CMAKE_PDB_OUTPUT_DIRECTORY if it is set when a target is created."
"\n"
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 1cb9f23..a236831 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1264,14 +1264,6 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
*this->BuildFileStream << configName
<< "</AssemblerListingLocation>\n";
this->WriteString("<ObjectFileName>$(IntDir)</ObjectFileName>\n", 3);
- if(this->Target->GetType() != cmTarget::OBJECT_LIBRARY)
- {
- this->WriteString("<ProgramDataBaseFileName>", 3);
- *this->BuildFileStream << this->Target->GetPDBDirectory(configName.c_str())
- << "/"
- << this->Target->GetPDBName(configName.c_str())
- << "</ProgramDataBaseFileName>\n";
- }
this->WriteString("</ClCompile>\n", 2);
}