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  53ece55f0bf137573118543409595c8b5bd4cf48 (commit)
       via  d0d2fdd4b55fa96c6964e908dc6361ec471456e7 (commit)
      from  b32b4cb4ec17e56f201dc92aea049ec2aaaaa062 (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=53ece55f0bf137573118543409595c8b5bd4cf48
commit 53ece55f0bf137573118543409595c8b5bd4cf48
Merge: b32b4cb d0d2fdd
Author:     Robert Maynard <robert.mayn...@kitware.com>
AuthorDate: Fri Jun 27 16:58:50 2014 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Fri Jun 27 16:58:50 2014 -0400

    Merge topic 'cuda_osx_clang' into next
    
    d0d2fdd4 FindCUDA: Fix OSX Clang & no C language enabled


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d0d2fdd4b55fa96c6964e908dc6361ec471456e7
commit d0d2fdd4b55fa96c6964e908dc6361ec471456e7
Author:     Adam Strzelecki <o...@java.pl>
AuthorDate: Thu Jun 12 19:46:50 2014 +0200
Commit:     Robert Maynard <robert.mayn...@kitware.com>
CommitDate: Fri Jun 27 16:58:05 2014 -0400

    FindCUDA: Fix OSX Clang & no C language enabled
    
    When setting default CUDA_HOST_COMPILER we must dereference 
CMAKE_C_COMPILER,
    i.e. /usr/bin/clang should be used instead /usr/bin/cc which is symlink.
    Otherwise CUDA thinks it is GCC and issues -dumpspecs which is unknown 
option
    to Clang.
    
    Also in case neither CMAKE_C_COMPILER is defined (project does not use C
    language) nor CUDA_HOST_COMPILER is specified manually we should skip -ccbin
    and let nvcc use its own default C compiler.

diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index d9809ad..9e6e2a3 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -452,7 +452,14 @@ set(CUDA_NVCC_FLAGS "" CACHE STRING "Semi-colon delimit 
multiple arguments.")
 if(CMAKE_GENERATOR MATCHES "Visual Studio")
   set(CUDA_HOST_COMPILER "$(VCInstallDir)bin" CACHE FILEPATH "Host side 
compiler used by NVCC")
 else()
-  set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "Host side 
compiler used by NVCC")
+  # Using cc which is symlink to clang may let NVCC think it is GCC and issue
+  # unhandled -dumpspecs option to clang.
+  if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER)
+    get_filename_component(c_compiler_realpath "${CMAKE_C_COMPILER}" REALPATH)
+  else()
+    set(c_compiler_realpath "")
+  endif()
+  set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side 
compiler used by NVCC")
 endif()
 
 # Propagate the host flags to the host compiler via -Xcompiler
@@ -1422,7 +1429,7 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS 
output_file cuda_target options
     # If -ccbin, --compiler-bindir has been specified, don't do anything.  
Otherwise add it here.
     list( FIND nvcc_flags "-ccbin" ccbin_found0 )
     list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 )
-    if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 )
+    if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER )
       list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"")
     endif()
     # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG}
diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake
index f0aac84..58e0d31 100644
--- a/Modules/FindCUDA/run_nvcc.cmake
+++ b/Modules/FindCUDA/run_nvcc.cmake
@@ -62,7 +62,7 @@ set(cmake_dependency_file "@cmake_dependency_file@") # path
 set(CUDA_make2cmake "@CUDA_make2cmake@") # path
 set(CUDA_parse_cubin "@CUDA_parse_cubin@") # path
 set(build_cubin @build_cubin@) # bool
-set(CUDA_HOST_COMPILER "@CUDA_HOST_COMPILER@") # bool
+set(CUDA_HOST_COMPILER "@CUDA_HOST_COMPILER@") # path
 # We won't actually use these variables for now, but we need to set this, in
 # order to force this file to be run again if it changes.
 set(generated_file_path "@generated_file_path@") # path
@@ -106,7 +106,7 @@ list(APPEND CUDA_NVCC_FLAGS 
${CUDA_NVCC_FLAGS_${build_configuration}})
 # Any -ccbin existing in CUDA_NVCC_FLAGS gets highest priority
 list( FIND CUDA_NVCC_FLAGS "-ccbin" ccbin_found0 )
 list( FIND CUDA_NVCC_FLAGS "--compiler-bindir" ccbin_found1 )
-if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 )
+if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER )
   if (CUDA_HOST_COMPILER STREQUAL "$(VCInstallDir)bin" AND DEFINED CCBIN)
     set(CCBIN -ccbin "${CCBIN}")
   else()

-----------------------------------------------------------------------

Summary of changes:
 Modules/FindCUDA.cmake          |   11 +++++++++--
 Modules/FindCUDA/run_nvcc.cmake |    4 ++--
 2 files changed, 11 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to