Skip to content
Snippets Groups Projects
Commit c14a6e35 authored by Sam Yates's avatar Sam Yates Committed by Benjamin Cumming
Browse files

Fix cpu architecture specification vs nvcc bug. (#578)

Fixes #575.

* Guard CPU architecture option for nvcc with generator expression.
parent eb4ed472
No related branches found
No related tags found
No related merge requests found
...@@ -135,5 +135,12 @@ function(set_arch_target optvar arch) ...@@ -135,5 +135,12 @@ function(set_arch_target optvar arch)
endif() endif()
endif() endif()
set("${optvar}" "${arch_opt}" PARENT_SCOPE) # Prefix architecture options with `-Xcompiler=` when compiling CUDA sources, i.e.
# with nvcc.
set(arch_opt_cuda_guarded)
foreach(opt ${arch_opt})
list(APPEND arch_opt_cuda_guarded "$<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=>${opt}")
endforeach()
set("${optvar}" "${arch_opt_cuda_guarded}" PARENT_SCOPE)
endfunction() endfunction()
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment