[Cmake-commits] CMake branch, next, updated. v3.2.1-1575-ge409a89
James Bigler
jamesbigler at gmail.com
Tue Apr 7 14:40:30 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 e409a8953a09e2a20428a6613115eb124796f808 (commit)
via 57661feb69e776c4c54681084237f16db7f32360 (commit)
via 7b7366a4a2f245088ff3eeb6f61d15226544a303 (commit)
from baadaeb5e3799cdd3cd2bb3c5b35b7d6c9f04047 (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=e409a8953a09e2a20428a6613115eb124796f808
commit e409a8953a09e2a20428a6613115eb124796f808
Merge: baadaeb 57661fe
Author: James Bigler <jamesbigler at gmail.com>
AuthorDate: Tue Apr 7 14:40:29 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Apr 7 14:40:29 2015 -0400
Merge topic 'FindCUDA.cmake/C++11Flags' into next
57661feb Make the search and replace for std=c++ understand --std and -std.
7b7366a4 Handling of c++11 host flag.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57661feb69e776c4c54681084237f16db7f32360
commit 57661feb69e776c4c54681084237f16db7f32360
Author: James Bigler <jamesbigler at gmail.com>
AuthorDate: Thu Apr 2 17:09:30 2015 -0600
Commit: James Bigler <jamesbigler at gmail.com>
CommitDate: Thu Apr 2 17:09:30 2015 -0600
Make the search and replace for std=c++ understand --std and -std.
When searching and replacing arguments, we need to consider equally --std and -std, and either could be present.
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index ce67131..54dd398 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -1192,11 +1192,11 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
if( _cuda_c11_host_flag_present )
# Add the c++11 flag to nvcc if it isn't already present. Note that we only look at
# the main flag instead of the configuration specific flags.
- string(REGEX MATCH "--std;c\\+\\+11" _cuda_c11_nvcc_flag_present "${CUDA_NVCC_FLAGS}")
+ string(REGEX MATCH "-std;c\\+\\+11" _cuda_c11_nvcc_flag_present "${CUDA_NVCC_FLAGS}")
if( NOT _cuda_c11_nvcc_flag_present )
list(APPEND nvcc_flags --std c++11)
endif()
- string(REPLACE "-std=c++11" "" _cuda_host_flags "${_cuda_host_flags}")
+ string(REGEX REPLACE "[-]+std=c\\+\\+11" "" _cuda_host_flags "${_cuda_host_flags}")
endif()
# Get the list of definitions from the directory property
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b7366a4a2f245088ff3eeb6f61d15226544a303
commit 7b7366a4a2f245088ff3eeb6f61d15226544a303
Author: James Bigler <jamesbigler at gmail.com>
AuthorDate: Sat Mar 21 23:01:24 2015 -0600
Commit: James Bigler <jamesbigler at gmail.com>
CommitDate: Sat Mar 21 23:01:24 2015 -0600
Handling of c++11 host flag.
If the host flags contain a c++11 flag (at least for gcc), then we can't
automatically propagate to nvcc it using -Xcompiler. This is because nvcc can't
use any C++ only flags. Instead we find this flag and add it to nvcc's flags
(it has a special flag for dealing with c++11 code) and remove it from the host
flags.
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 81e1cad..ce67131 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -1184,6 +1184,21 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
set(_cuda_nvcc_flags_config "${_cuda_nvcc_flags_config}\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})")
endforeach()
+ # Process the C++11 flag. If the host sets the flag, we need to add it to nvcc and
+ # remove it from the host. This is because -Xcompile -std=c++ will choke nvcc (it uses
+ # the C preprocessor). In order to get this to work correctly, we need to use nvcc's
+ # specific c++11 flag.
+ string(REGEX MATCH "-std=c\\+\\+11" _cuda_c11_host_flag_present "${_cuda_host_flags}")
+ if( _cuda_c11_host_flag_present )
+ # Add the c++11 flag to nvcc if it isn't already present. Note that we only look at
+ # the main flag instead of the configuration specific flags.
+ string(REGEX MATCH "--std;c\\+\\+11" _cuda_c11_nvcc_flag_present "${CUDA_NVCC_FLAGS}")
+ if( NOT _cuda_c11_nvcc_flag_present )
+ list(APPEND nvcc_flags --std c++11)
+ endif()
+ string(REPLACE "-std=c++11" "" _cuda_host_flags "${_cuda_host_flags}")
+ endif()
+
# Get the list of definitions from the directory property
get_directory_property(CUDA_NVCC_DEFINITIONS COMPILE_DEFINITIONS)
if(CUDA_NVCC_DEFINITIONS)
-----------------------------------------------------------------------
Summary of changes:
Modules/FindCUDA.cmake | 15 +++++++++++++++
1 file changed, 15 insertions(+)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list