Skip to content

Commit

Permalink
fix Ninja incremental compile bug of warpctc (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhwesky2010 authored May 27, 2021
1 parent c690fc5 commit 37ece0e
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,9 @@ function(windows_symbolic TARGET)
endif()

# only copy the xx.cu to .xx.cu when the content are modified
set(copy_flag 1)
if (EXISTS ${final_path}/.${src}.cu)
file(READ ${final_path}/${src}.cpp SOURCE_STR)
file(READ ${final_path}/.${src}.cu TARGET_STR)
if (SOURCE_STR STREQUAL TARGET_STR)
set(copy_flag 0)
endif()
endif()
if (copy_flag)
add_custom_command(OUTPUT ${final_path}/.${src}.cu
COMMAND ${CMAKE_COMMAND} -E remove ${final_path}/.${src}.cu
COMMAND ${CMAKE_COMMAND} -E copy "${final_path}/${src}.cpp" "${final_path}/.${src}.cu"
COMMENT "create hidden file of ${src}.cu")
endif(copy_flag)
add_custom_command(OUTPUT ${final_path}/.${src}.cu
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${final_path}/${src}.cpp" "${final_path}/.${src}.cu"
COMMENT "create hidden file of ${src}.cu")
add_custom_target(${TARGET} ALL DEPENDS ${final_path}/.${src}.cu)
endforeach()
endfunction()
Expand Down

0 comments on commit 37ece0e

Please sign in to comment.