This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via 7f19de3c6b559bd3529de46d2017d0a5a2b5cf10 (commit) via b6e9b8f1270914ed509bda2c53ea9c30dfd09d54 (commit) from 533bbb474f936f1326537ba0aaf9f9a2b2b97a1a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f19de3c6b559bd3529de46d2017d0a5a2b5cf10 commit 7f19de3c6b559bd3529de46d2017d0a5a2b5cf10 Merge: 533bbb4 b6e9b8f Author: James Bigler <jamesbig...@gmail.com> AuthorDate: Thu Mar 14 12:55:43 2013 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Thu Mar 14 12:55:43 2013 -0400 Merge topic 'FindCUDA.cmake/SeparableCompilation' into next b6e9b8f FindCUDA: Use the PRE_LINK mode only for MSVC >= 10 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b6e9b8f1270914ed509bda2c53ea9c30dfd09d54 commit b6e9b8f1270914ed509bda2c53ea9c30dfd09d54 Author: James Bigler <jamesbig...@gmail.com> AuthorDate: Wed Mar 13 23:57:37 2013 -0600 Commit: Brad King <brad.k...@kitware.com> CommitDate: Thu Mar 14 09:57:15 2013 -0400 FindCUDA: Use the PRE_LINK mode only for MSVC >= 10 Use normal custom command dependencies by default. Use the PRE_LINK approach only to work around what seems to be a bug in msbuild handling of custom build rules that chain together. diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 03e4f3f..cd4dd20 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1327,13 +1327,6 @@ endfunction() function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options object_files) if (object_files) - if(NOT EXISTS "${output_file}") - # Some generators (e.g. makefiles) can't proceed to the link phase if all - # input files aren't available. This guarantees the file exists, so that - # linking can begin. - execute_process(COMMAND ${CMAKE_COMMAND} -E touch "${output_file}") - endif() - set_source_files_properties("${output_file}" PROPERTIES EXTERNAL_OBJECT TRUE # This is an object file not to be compiled, but only @@ -1365,12 +1358,34 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options endforeach() endforeach() file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}") - add_custom_command( - TARGET ${cuda_target} - PRE_LINK - COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" - COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" - ) + + # Some generators don't handle the multiple levels of custom command + # dependencies correctly (obj1 depends on file1, obj2 depends on obj1), so + # we work around that issue by compiling the intermediate link object as a + # pre-link custom command in that situation. + set(do_obj_build_rule TRUE) + if (MSVC_VERSION GREATER 1599) + # VS 2010 and 2012 have this problem. If future versions fix this issue, + # it should still work, it just won't be as nice as the other method. + set(do_obj_build_rule FALSE) + endif() + + if (do_obj_build_rule) + add_custom_command( + OUTPUT ${output_file} + DEPENDS ${object_files} + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file} + ${flags} + COMMENT "Building NVCC intermediate link file ${output_file_relative_path}" + ) + else() + add_custom_command( + TARGET ${cuda_target} + PRE_LINK + COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" + ) + endif() endif() endfunction() ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 41 ++++++++++++++++++++++++++++------------- 1 files changed, 28 insertions(+), 13 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits