|
|
@@ -495,10 +495,12 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
|
|
|
if(CMAKE_VS_PLATFORM_NAME STREQUAL x64)
|
|
|
set(cuda_target "<TargetMachinePlatform>64</TargetMachinePlatform>")
|
|
|
endif()
|
|
|
- foreach(arch ${CMAKE_CUDA_ARCHITECTURES})
|
|
|
- string(REGEX MATCH "[0-9]+" arch_name "${arch}")
|
|
|
- string(APPEND cuda_codegen "compute_${arch_name},sm_${arch_name};")
|
|
|
- endforeach()
|
|
|
+ if(NOT CMAKE_CUDA_ARCHITECTURES MATCHES "^(all|all-major)$")
|
|
|
+ foreach(arch ${CMAKE_CUDA_ARCHITECTURES})
|
|
|
+ string(REGEX MATCH "[0-9]+" arch_name "${arch}")
|
|
|
+ string(APPEND cuda_codegen "compute_${arch_name},sm_${arch_name};")
|
|
|
+ endforeach()
|
|
|
+ endif()
|
|
|
set(id_ItemDefinitionGroup_entry "<CudaCompile>${cuda_target}<AdditionalOptions>%(AdditionalOptions)-v</AdditionalOptions><CodeGeneration>${cuda_codegen}</CodeGeneration></CudaCompile>")
|
|
|
set(id_PostBuildEvent_Command [[echo CMAKE_CUDA_COMPILER=$(CudaToolkitBinDir)\nvcc.exe]])
|
|
|
if(CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR)
|