[Cmake-commits] CMake branch, next, updated. v3.2.1-1649-gf920f7e

Brad King brad.king at kitware.com
Wed Apr 8 16:26:36 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  f920f7e2eab01001ecd438b4f5aec759ce684249 (commit)
       via  99abebdea01b9ef73e091db5594553f7b1694a1b (commit)
      from  88c25e5c71578dd0fdd7bf02a108e28dacde94b0 (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=f920f7e2eab01001ecd438b4f5aec759ce684249
commit f920f7e2eab01001ecd438b4f5aec759ce684249
Merge: 88c25e5 99abebd
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Apr 8 16:26:35 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Apr 8 16:26:35 2015 -0400

    Merge topic 'FindCUDA.cmake/C++11Flags' into next
    
    99abebde FindCUDA: Handle c++11 host flag


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=99abebdea01b9ef73e091db5594553f7b1694a1b
commit 99abebdea01b9ef73e091db5594553f7b1694a1b
Author:     James Bigler <jamesbigler at gmail.com>
AuthorDate: Sat Mar 21 23:01:24 2015 -0600
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Apr 8 16:25:47 2015 -0400

    FindCUDA: Handle 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.
    
    Co-Author: Guillermo Marcus <gmarcus at nvidia.com>

diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 81e1cad..7d9f772 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -1184,6 +1184,19 @@ 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.
+  if( "${_cuda_host_flags}" MATCHES "-std=c\\+\\+11")
+    # 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.
+    if( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std;c\\+\\+11" )
+      list(APPEND nvcc_flags --std c++11)
+    endif()
+    string(REGEX 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:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list