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)
endif()
endif()
# 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)
if (ARB_WITH_GPU)
# 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)
endif()
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