From a3e442bbfc8374c90aec9836ee40aa35a43c1bc2 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 26 Jun 2017 10:41:03 -0400 Subject: FindCUDA: Fix CUDA_NVCC_FLAGS_ for separable compilation Since commit v3.0.0-rc6~3^2 (FindCUDA: Use CUDA_NVCC_FLAGS* for separable compilation, 2014-05-18), using the feature for one configuration results in empty-string ("") arguments on the command line for other configurations. This is because the generator expression for a non-matching configuration evaluates to an empty string but does not remove the argument. Use `COMMAND_EXPAND_LISTS` to remove the empty arguments from the custom command after genex evaluation. Fixes: #16411 --- Modules/FindCUDA.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index a4dca54..7f1ff57 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1698,6 +1698,7 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file} ${flags} COMMENT "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND_EXPAND_LISTS ${_verbatim} ) else() @@ -1708,6 +1709,7 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}" COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" + COMMAND_EXPAND_LISTS ${_verbatim} ) endif() -- cgit v0.12