Skip to content
Snippets Groups Projects
Unverified Commit 2d9980cc authored by Benjamin Cumming's avatar Benjamin Cumming Committed by GitHub
Browse files

Only make CUDA -march workaround if compiling with CUDA target (#585)

Fixes #584.
parent 2059c285
No related branches found
No related tags found
No related merge requests found
...@@ -135,12 +135,15 @@ function(set_arch_target optvar arch) ...@@ -135,12 +135,15 @@ function(set_arch_target optvar arch)
endif() endif()
endif() endif()
# Prefix architecture options with `-Xcompiler=` when compiling CUDA sources, i.e. if (ARB_WITH_GPU)
# with nvcc. # Prefix architecture options with `-Xcompiler=` when compiling CUDA sources, i.e.
set(arch_opt_cuda_guarded) # with nvcc.
foreach(opt ${arch_opt}) set(arch_opt_cuda_guarded)
list(APPEND arch_opt_cuda_guarded "$<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=>${opt}") foreach(opt ${arch_opt})
endforeach() list(APPEND arch_opt_cuda_guarded "$<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=>${opt}")
endforeach()
set("${optvar}" "${arch_opt_cuda_guarded}" PARENT_SCOPE)
set("${optvar}" "${arch_opt_cuda_guarded}" PARENT_SCOPE)
endif()
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