summaryrefslogtreecommitdiffstats
path: root/Tests/PDBDirectoryAndName
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 /Tests/PDBDirectoryAndName
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 'Tests/PDBDirectoryAndName')
-rw-r--r--Tests/PDBDirectoryAndName/CMakeLists.txt11
1 files changed, 5 insertions, 6 deletions
diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt
index bc2f013..28e46b1 100644
--- a/Tests/PDBDirectoryAndName/CMakeLists.txt
+++ b/Tests/PDBDirectoryAndName/CMakeLists.txt
@@ -20,7 +20,9 @@ set_target_properties(mylibB PROPERTIES
PDB_NAME "mylibB_Special"
PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mylibB_PDB"
)
-list(APPEND my_targets mylibB)
+# TODO: The only .pdb available for a static library is that generated
+# by the compiler /Fd option which is not the same as the linker /pdb.
+# list(APPEND my_targets mylibB)
add_library(mylibC SHARED mylibC.c)
set_target_properties(mylibC PROPERTIES
@@ -32,7 +34,8 @@ add_library(mylibD STATIC mylibD.c)
set_target_properties(mylibD PROPERTIES
PDB_NAME "mylibD_Special"
)
-list(APPEND my_targets mylibD)
+# TODO: See comment for mylibB.
+# list(APPEND my_targets mylibD)
add_executable(myexe myexe.c)
set_target_properties(myexe PROPERTIES
@@ -58,10 +61,6 @@ target_link_libraries(myexe2 mylibA mylibD)
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
return()
endif()
-# PDB output not fully implemented for Intel
-if("${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
- return()
-endif()
set(pdbs "")
foreach(t ${my_targets})