diff options
author | Brad King <brad.king@kitware.com> | 2018-04-16 13:13:58 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-04-16 13:14:05 (GMT) |
commit | 5099af044fc737fef6215ccacdce3bb4c9f3d957 (patch) | |
tree | 11fee1f6f3cc73070c3815abc4abcd12b8683e64 /Tests | |
parent | 5e4c5b53e165fe6dd87eb766d3d21889914086dd (diff) | |
parent | 134e795fa968a06e289f1449b6ca4bf4702da03b (diff) | |
download | CMake-5099af044fc737fef6215ccacdce3bb4c9f3d957.zip CMake-5099af044fc737fef6215ccacdce3bb4c9f3d957.tar.gz CMake-5099af044fc737fef6215ccacdce3bb4c9f3d957.tar.bz2 |
Merge topic 'vs-cuda-pdb'
134e795fa9 VS: Add workaround for CUDA compiler PDB location
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1960
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CudaOnly/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/CudaOnly/PDB/CMakeLists.txt | 19 | ||||
-rw-r--r-- | Tests/CudaOnly/PDB/check_pdbs.cmake | 10 | ||||
-rw-r--r-- | Tests/CudaOnly/PDB/main.cu | 4 |
4 files changed, 37 insertions, 0 deletions
diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt index 565baca..59f3e84 100644 --- a/Tests/CudaOnly/CMakeLists.txt +++ b/Tests/CudaOnly/CMakeLists.txt @@ -6,3 +6,7 @@ ADD_TEST_MACRO(CudaOnly.LinkSystemDeviceLibraries CudaOnlyLinkSystemDeviceLibrar ADD_TEST_MACRO(CudaOnly.ResolveDeviceSymbols CudaOnlyResolveDeviceSymbols) ADD_TEST_MACRO(CudaOnly.SeparateCompilation CudaOnlySeparateCompilation) ADD_TEST_MACRO(CudaOnly.WithDefs CudaOnlyWithDefs) + +if(MSVC) + ADD_TEST_MACRO(CudaOnly.PDB CudaOnlyPDB) +endif() diff --git a/Tests/CudaOnly/PDB/CMakeLists.txt b/Tests/CudaOnly/PDB/CMakeLists.txt new file mode 100644 index 0000000..34e1e5c --- /dev/null +++ b/Tests/CudaOnly/PDB/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.11) +project (CudaOnlyPDB CUDA) + +add_executable(CudaOnlyPDB main.cu) +set_target_properties(CudaOnlyPDB PROPERTIES + PDB_NAME LinkPDBName + PDB_OUTPUT_DIRECTORY LinkPDBDir + COMPILE_PDB_NAME CompPDBName + COMPILE_PDB_OUTPUT_DIRECTORY CompPDBDir + ) + +set(pdbs + ${CMAKE_CURRENT_BINARY_DIR}/CompPDBDir/${CMAKE_CFG_INTDIR}/CompPDBName.pdb + ${CMAKE_CURRENT_BINARY_DIR}/LinkPDBDir/${CMAKE_CFG_INTDIR}/LinkPDBName.pdb + ) +add_custom_command(TARGET CudaOnlyPDB POST_BUILD + COMMAND ${CMAKE_COMMAND} -Dconfig=$<CONFIG> "-Dpdbs=${pdbs}" + -P ${CMAKE_CURRENT_SOURCE_DIR}/check_pdbs.cmake + ) diff --git a/Tests/CudaOnly/PDB/check_pdbs.cmake b/Tests/CudaOnly/PDB/check_pdbs.cmake new file mode 100644 index 0000000..5e01ca7 --- /dev/null +++ b/Tests/CudaOnly/PDB/check_pdbs.cmake @@ -0,0 +1,10 @@ +if(NOT "${config}" MATCHES "[Dd][Ee][Bb]") + return() +endif() +foreach(pdb ${pdbs}) + if(EXISTS "${pdb}") + message(STATUS "PDB Exists: ${pdb}") + else() + message(SEND_ERROR "PDB MISSING:\n ${pdb}") + endif() +endforeach() diff --git a/Tests/CudaOnly/PDB/main.cu b/Tests/CudaOnly/PDB/main.cu new file mode 100644 index 0000000..f8b643a --- /dev/null +++ b/Tests/CudaOnly/PDB/main.cu @@ -0,0 +1,4 @@ +int main() +{ + return 0; +} |