[Cmake-commits] CMake branch, next, updated. v3.3.0-rc2-461-gc4c6bc8
Brad King
brad.king at kitware.com
Mon Jun 15 09:42:05 EDT 2015
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 c4c6bc8962120c24dd37eadabfb58d3a69f023a5 (commit)
via b405f01daaeaeda98d448e2f0d71ea685757a5bd (commit)
from 2ceef36bfd7eaf937f2a3ffc387c2be160cdb31b (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=c4c6bc8962120c24dd37eadabfb58d3a69f023a5
commit c4c6bc8962120c24dd37eadabfb58d3a69f023a5
Merge: 2ceef36 b405f01
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Jun 15 09:42:04 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jun 15 09:42:04 2015 -0400
Merge topic 'FindCUDA-fix-ccache' into next
b405f01d FindCUDA: Resolve a host compiler symlink only if it is Apple cc -> clang
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b405f01daaeaeda98d448e2f0d71ea685757a5bd
commit b405f01daaeaeda98d448e2f0d71ea685757a5bd
Author: Bill Hoffman <bill.hoffman at kitware.com>
AuthorDate: Fri Jun 12 14:16:09 2015 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Jun 15 09:41:10 2015 -0400
FindCUDA: Resolve a host compiler symlink only if it is Apple cc -> clang
Otherwise using a "cc -> ccache" or similar symlink as the compiler
causes FindCUDA to select ccache as the host compiler. Update the logic
added by commit v3.1.0-rc1~354^2 (FindCUDA: Fix OSX Clang & no C
language enabled, 2014-06-12) to apply only in the specific case it is
needed.
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index e8e1fb1..f4b0783 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -468,17 +468,31 @@ 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()
- # Using cc which is symlink to clang may let NVCC think it is GCC and issue
- # unhandled -dumpspecs 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.
- if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER)
- get_filename_component(c_compiler_realpath "${CMAKE_C_COMPILER}" REALPATH)
+ if(APPLE
+ AND "${CMAKE_C_COMPILER_ID}" MATCHES "Clang"
+ AND "${CMAKE_C_COMPILER}" MATCHES "/cc$")
+ # Using cc which is symlink to clang may let NVCC think it is GCC and issue
+ # unhandled -dumpspecs 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.
+ # Only care about this on APPLE with clang to avoid
+ # following symlinks to things like ccache
+ if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER)
+ get_filename_component(c_compiler_realpath "${CMAKE_C_COMPILER}" REALPATH)
+ # if the real path does not end up being clang then
+ # go back to using CMAKE_C_COMPILER
+ if(NOT "${c_compiler_realpath}" MATCHES "/clang$")
+ set(c_compiler_realpath "${CMAKE_C_COMPILER}")
+ endif()
+ else()
+ set(c_compiler_realpath "")
+ endif()
+ set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side compiler used by NVCC")
else()
- set(c_compiler_realpath "")
+ set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}"
+ CACHE FILEPATH "Host side compiler used by NVCC")
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
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list