summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-01-17 22:02:15 (GMT)
committerBrad King <brad.king@kitware.com>2024-01-22 14:33:54 (GMT)
commit88c740462c63b09a20b4eeac0aa6ef182cb0c5dd (patch)
treead50f0a7aa4d0b0594c4ad11543f33bcf5e92f46 /Tests
parent62ca95518e37e9bc9fd4ae4b898f78c4d4c4893b (diff)
downloadCMake-88c740462c63b09a20b4eeac0aa6ef182cb0c5dd.zip
CMake-88c740462c63b09a20b4eeac0aa6ef182cb0c5dd.tar.gz
CMake-88c740462c63b09a20b4eeac0aa6ef182cb0c5dd.tar.bz2
CUDA/Clang: Add support for MSVC ABI on Windows using GNU-like frontend
Fixes: #20776
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Cuda/CMakeLists.txt6
-rw-r--r--Tests/CudaOnly/CMakeLists.txt4
-rw-r--r--Tests/MSVCDebugInformationFormat/override-CUDA.cmake1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Common.cmake2
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake3
5 files changed, 12 insertions, 4 deletions
diff --git a/Tests/Cuda/CMakeLists.txt b/Tests/Cuda/CMakeLists.txt
index efe0358..04ef86d 100644
--- a/Tests/Cuda/CMakeLists.txt
+++ b/Tests/Cuda/CMakeLists.txt
@@ -9,8 +9,10 @@ add_cuda_test_macro(Cuda.ObjectLibrary CudaObjectLibrary)
add_cuda_test_macro(Cuda.MixedStandardLevels1 MixedStandardLevels1)
add_cuda_test_macro(Cuda.MixedStandardLevels2 MixedStandardLevels2)
add_cuda_test_macro(Cuda.MixedStandardLevels3 MixedStandardLevels3)
-add_cuda_test_macro(Cuda.MixedStandardLevels4 MixedStandardLevels4)
-add_cuda_test_macro(Cuda.MixedStandardLevels5 MixedStandardLevels5)
+if(NOT WIN32 OR NOT CMake_TEST_CUDA STREQUAL "Clang") # MSVC std lib needs C++14
+ add_cuda_test_macro(Cuda.MixedStandardLevels4 MixedStandardLevels4)
+ add_cuda_test_macro(Cuda.MixedStandardLevels5 MixedStandardLevels5)
+endif()
add_cuda_test_macro(Cuda.NotEnabled CudaNotEnabled)
add_cuda_test_macro(Cuda.SeparableCompCXXOnly SeparableCompCXXOnly)
add_cuda_test_macro(Cuda.StubRPATH StubRPATH)
diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt
index 9f49498..128d371 100644
--- a/Tests/CudaOnly/CMakeLists.txt
+++ b/Tests/CudaOnly/CMakeLists.txt
@@ -11,7 +11,9 @@ add_cuda_test_macro(CudaOnly.EnableStandard CudaOnlyEnableStandard)
add_cuda_test_macro(CudaOnly.ExportPTX CudaOnlyExportPTX)
add_cuda_test_macro(CudaOnly.SharedRuntimePlusToolkit CudaOnlySharedRuntimePlusToolkit)
add_cuda_test_macro(CudaOnly.StaticRuntimePlusToolkit CudaOnlyStaticRuntimePlusToolkit)
-add_cuda_test_macro(CudaOnly.Standard98 CudaOnlyStandard98)
+if(NOT WIN32 OR NOT CMake_TEST_CUDA STREQUAL "Clang") # MSVC std lib needs C++14
+ add_cuda_test_macro(CudaOnly.Standard98 CudaOnlyStandard98)
+endif()
set(CudaOnly.Toolkit_BUILD_OPTIONS -DHAS_CUPTI:BOOL=${CMake_TEST_CUDA_CUPTI})
add_cuda_test_macro(CudaOnly.Toolkit CudaOnlyToolkit)
add_cuda_test_macro(CudaOnly.ToolkitBeforeLang CudaOnlyToolkitBeforeLang)
diff --git a/Tests/MSVCDebugInformationFormat/override-CUDA.cmake b/Tests/MSVCDebugInformationFormat/override-CUDA.cmake
index f870775..eaa7bff 100644
--- a/Tests/MSVCDebugInformationFormat/override-CUDA.cmake
+++ b/Tests/MSVCDebugInformationFormat/override-CUDA.cmake
@@ -1,5 +1,6 @@
set(var "CMAKE_CUDA_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_Embedded")
string(REPLACE "-Z7" "-Z7;-DTEST_Z7" "${var}" "${${var}}")
+string(REPLACE "-gcodeview" "-gcodeview;-DTEST_Z7" "${var}" "${${var}}")
set(var "CMAKE_CUDA_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_ProgramDatabase")
string(REPLACE "-Zi" "-Zi;-DTEST_Zi" "${var}" "${${var}}")
set(var "CMAKE_CUDA_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_EditAndContinue")
diff --git a/Tests/RunCMake/NinjaMultiConfig/Common.cmake b/Tests/RunCMake/NinjaMultiConfig/Common.cmake
index 6c0d82a..9343eaf 100644
--- a/Tests/RunCMake/NinjaMultiConfig/Common.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/Common.cmake
@@ -37,7 +37,7 @@ function(generate_output_files)
set(exe_file " [==[$<TARGET_FILE_DIR:${tgt}>/$<TARGET_FILE_PREFIX:${tgt}>$<TARGET_FILE_BASE_NAME:${tgt}>$<TARGET_FILE_SUFFIX:${tgt}>]==]")
set(exe_filename " [==[$<TARGET_FILE_PREFIX:${tgt}>$<TARGET_FILE_BASE_NAME:${tgt}>$<TARGET_FILE_SUFFIX:${tgt}>]==]")
- if(WIN32)
+ if(WIN32 AND NOT generate_output_files_NO_EXE_LIB)
set(exe_lib_file " [==[$<TARGET_FILE_DIR:${tgt}>/$<TARGET_FILE_PREFIX:${tgt}>$<TARGET_FILE_BASE_NAME:${tgt}>.lib]==]")
string(APPEND content "set(TARGET_EXE_LIB_FILE_${tgt}_$<CONFIG>${exe_lib_file})\n")
endif()
diff --git a/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake b/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake
index 00d8a1b..b5fc5b6 100644
--- a/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake
@@ -16,6 +16,9 @@ set_target_properties(simplecudaobj simplecudashared
add_executable(simplecudaexe main.cu )
target_link_libraries(simplecudaexe PRIVATE simplecudashared)
+if(WIN32 AND CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")
+ set(generate_output_files_NO_EXE_LIB 1)
+endif()
include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
generate_output_files(simplecudaexe simplecudashared simplecudaobj)