summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-19 14:40:24 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-05-19 14:40:24 (GMT)
commit7019152aa2951ba14bd89c4805a9a9bdb17e7060 (patch)
tree9e1a6a1b6ea585d1ee0608817dd0f6a895961880
parent87eab93ad61fffda0ec4f9e779a325178183f7be (diff)
parent6ad14c71bb9b791fc4496a4d6a3fcd6dd9bf3f1c (diff)
downloadCMake-7019152aa2951ba14bd89c4805a9a9bdb17e7060.zip
CMake-7019152aa2951ba14bd89c4805a9a9bdb17e7060.tar.gz
CMake-7019152aa2951ba14bd89c4805a9a9bdb17e7060.tar.bz2
Merge topic 'FindCUDA-separable-compilation-flags'
6ad14c71 FindCUDA: Use CUDA_NVCC_FLAGS* for separable compilation
-rw-r--r--Modules/FindCUDA.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 1f69620..d1c31a4 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -1430,15 +1430,24 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 )
list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"")
endif()
+ # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG}
+ set(config_specific_flags)
set(flags)
foreach(config ${CUDA_configuration_types})
string(TOUPPER ${config} config_upper)
+ # Add config specific flags
+ foreach(f ${CUDA_NVCC_FLAGS_${config_upper}})
+ list(APPEND config_specific_flags $<$<CONFIG:${config}>:${f}>)
+ endforeach()
set(important_host_flags)
_cuda_get_important_host_flags(important_host_flags ${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}})
foreach(f ${important_host_flags})
list(APPEND flags $<$<CONFIG:${config}>:-Xcompiler> $<$<CONFIG:${config}>:${f}>)
endforeach()
endforeach()
+ # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags
+ set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags})
+
file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}")
# Some generators don't handle the multiple levels of custom command