summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-02-26 14:38:51 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-02-26 14:38:51 (GMT)
commit6223621e9a4bfc7bbf91037183c725c4300db397 (patch)
tree97ed8192c19a5b81048300a4912ffaeff09b4527 /Tests
parent5cad466daefa64578d4e4ca0394db983ab40bba4 (diff)
parentfba51b096e2d8ec281653aa05720c11dc9b9bfe6 (diff)
downloadCMake-6223621e9a4bfc7bbf91037183c725c4300db397.zip
CMake-6223621e9a4bfc7bbf91037183c725c4300db397.tar.gz
CMake-6223621e9a4bfc7bbf91037183c725c4300db397.tar.bz2
Merge topic 'msvc-compiler-pdb-files'
fba51b09 MSVC: Add properties to configure compiler PDB files (#14762) 3737860a cmTarget: Add per-config compilation info 718a9532 cmTarget: Refactor ComputePDBOutputDir interface aae5184c Help: Refactor PDB_NAME and PDB_OUTPUT_DIRECTORY docs b4aac0ca Makefile: Fix per-config linker PDB output directory
Diffstat (limited to 'Tests')
-rw-r--r--Tests/PDBDirectoryAndName/CMakeLists.txt30
1 files changed, 22 insertions, 8 deletions
diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt
index 28e46b1..90af600 100644
--- a/Tests/PDBDirectoryAndName/CMakeLists.txt
+++ b/Tests/PDBDirectoryAndName/CMakeLists.txt
@@ -6,6 +6,13 @@ if(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
message(FATAL_ERROR "The PDBDirectoryAndName test works only with MSVC or Intel")
endif()
+# Intel 11.1 does not support /Fd but Intel 14.0 does.
+# TODO: Did a version in between these add it?
+if(CMAKE_C_COMPILER_ID STREQUAL Intel AND
+ CMAKE_C_COMPILER_VERSION VERSION_LESS 14.0)
+ set(NO_COMPILE_PDB 1)
+endif()
+
set(my_targets "")
add_library(mylibA SHARED mylibA.c)
@@ -17,12 +24,12 @@ list(APPEND my_targets mylibA)
add_library(mylibB STATIC mylibB.c)
set_target_properties(mylibB PROPERTIES
- PDB_NAME "mylibB_Special"
- PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mylibB_PDB"
+ COMPILE_PDB_NAME "mylibB_Special"
+ COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mylibB_PDB"
)
-# 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)
+if(NOT NO_COMPILE_PDB)
+ list(APPEND my_targets mylibB)
+endif()
add_library(mylibC SHARED mylibC.c)
set_target_properties(mylibC PROPERTIES
@@ -32,10 +39,11 @@ list(APPEND my_targets mylibC)
add_library(mylibD STATIC mylibD.c)
set_target_properties(mylibD PROPERTIES
- PDB_NAME "mylibD_Special"
+ COMPILE_PDB_NAME "mylibD_Special"
)
-# TODO: See comment for mylibB.
-# list(APPEND my_targets mylibD)
+if(NOT NO_COMPILE_PDB)
+ list(APPEND my_targets mylibD)
+endif()
add_executable(myexe myexe.c)
set_target_properties(myexe PROPERTIES
@@ -66,6 +74,12 @@ set(pdbs "")
foreach(t ${my_targets})
get_property(pdb_name TARGET ${t} PROPERTY PDB_NAME)
get_property(pdb_dir TARGET ${t} PROPERTY PDB_OUTPUT_DIRECTORY)
+ if(NOT pdb_name)
+ get_property(pdb_name TARGET ${t} PROPERTY COMPILE_PDB_NAME)
+ endif()
+ if(NOT pdb_dir)
+ get_property(pdb_dir TARGET ${t} PROPERTY COMPILE_PDB_OUTPUT_DIRECTORY)
+ endif()
if(NOT pdb_dir)
set(pdb_dir ${CMAKE_CURRENT_BINARY_DIR})
endif()