Просмотр исходного кода

FindCUDA: Fix for when a non-existent dependency file is found.

Previously if a non-existent dependency file is found we set the file to "" and
then do if(NOT IS_DIRECTORY "${file}").  Later we call get_filename_component
on the empty file which returns basically the current build directory.

Having a dependency on the current build directory is really annoying, because
anything that compiles into that directory will change the file stamp and
cause your files to rebuild every time you call make. :(
James Bigler 9 лет назад
Родитель
Сommit
4b561b4cb5
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      Modules/FindCUDA/make2cmake.cmake

+ 1 - 1
Modules/FindCUDA/make2cmake.cmake

@@ -67,7 +67,7 @@ if (NOT "${depend_text}" STREQUAL "")
       endif()
       endif()
     endif()
     endif()
 
 
-    if(NOT IS_DIRECTORY "${file}")
+    if(file AND NOT IS_DIRECTORY "${file}")
       # If softlinks start to matter, we should change this to REALPATH.  For now we need
       # If softlinks start to matter, we should change this to REALPATH.  For now we need
       # to flatten paths, because nvcc can generate stuff like /bin/../include instead of
       # to flatten paths, because nvcc can generate stuff like /bin/../include instead of
       # just /include.
       # just /include.