[Cmake-commits] CMake branch, next, updated. v3.2.1-1654-g311d165

James Bigler jamesbigler at gmail.com
Wed Apr 8 17:11:50 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  311d1653f9f79a4fe719491a116425aa56d95f78 (commit)
       via  f0614dd68b2e7d7d939de807411a23ecc7df3722 (commit)
       via  f6ffc18f28fc00be7f3fafdc6b063f4bac5226b1 (commit)
       via  094dff091da1125102c3e55890317af748798d8b (commit)
       via  2b475cd517f9ec42e1ccd2b72edab988ab2c178d (commit)
      from  f920f7e2eab01001ecd438b4f5aec759ce684249 (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=311d1653f9f79a4fe719491a116425aa56d95f78
commit 311d1653f9f79a4fe719491a116425aa56d95f78
Merge: f920f7e f0614dd
Author:     James Bigler <jamesbigler at gmail.com>
AuthorDate: Wed Apr 8 17:11:49 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Apr 8 17:11:49 2015 -0400

    Merge topic 'FindCUDA.cmake/CUDA_SOURCE_FILE' into next
    
    f0614dd6 Merge topic 'link-implicit-libs-full-path' into FindCUDA.cmake/CUDA_SOURCE_FILE
    f6ffc18f Merge topic 'cmake-command-line-help-vs-arch' into FindCUDA.cmake/CUDA_SOURCE_FILE
    094dff09 Add specific cuda_language_flag instead of using nvcc. Fixes bug.
    2b475cd5 Allow setting CUDA_SOURCE_PROPERTY_FORMAT for non-.cu files.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f0614dd68b2e7d7d939de807411a23ecc7df3722
commit f0614dd68b2e7d7d939de807411a23ecc7df3722
Merge: f6ffc18 f4e6341
Author:     James Bigler <jamesbigler at gmail.com>
AuthorDate: Wed Apr 8 15:09:29 2015 -0600
Commit:     James Bigler <jamesbigler at gmail.com>
CommitDate: Wed Apr 8 15:09:29 2015 -0600

    Merge topic 'link-implicit-libs-full-path' into FindCUDA.cmake/CUDA_SOURCE_FILE


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f6ffc18f28fc00be7f3fafdc6b063f4bac5226b1
commit f6ffc18f28fc00be7f3fafdc6b063f4bac5226b1
Merge: 094dff0 1e38433
Author:     James Bigler <jamesbigler at gmail.com>
AuthorDate: Wed Apr 8 15:08:22 2015 -0600
Commit:     James Bigler <jamesbigler at gmail.com>
CommitDate: Wed Apr 8 15:08:22 2015 -0600

    Merge topic 'cmake-command-line-help-vs-arch' into FindCUDA.cmake/CUDA_SOURCE_FILE
    
    Documentation comments collided with other commit.
    
    Conflicts:
    	Modules/FindCUDA.cmake

diff --cc Modules/FindCUDA.cmake
index 054ffbd,8f80993..3d994b9
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@@ -106,11 -106,10 +106,17 @@@
  #      CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
  #      CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called.
  #
 +#   CUDA_SOURCE_PROPERTY_FORMAT
- #   -- If this source file property is set, it can override the format specified to
- #      CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN).  If an input source file is not a .cu
- #      file, setting this file will cause it to be treated as a .cu file. See
- #      documentation for set_source_files_properties on how to set this property.
++#   -- If this source file property is set, it can override the format specified
++#      to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN).  If an input source file
++#      is not a .cu file, setting this file will cause it to be treated as a .cu
++#      file. See documentation for set_source_files_properties on how to set
++#      this property.
++#
+ #   CUDA_USE_STATIC_CUDA_RUNTIME (Default ON)
+ #   -- When enabled the static version of the CUDA runtime library will be used
+ #      in CUDA_LIBRARIES.  If the version of CUDA configured doesn't support
+ #      this option, then it will be silently disabled.
  #
  #   CUDA_VERBOSE_BUILD (Default OFF)
  #   -- Set to ON to see all the commands used when building the CUDA file.  When

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=094dff091da1125102c3e55890317af748798d8b
commit 094dff091da1125102c3e55890317af748798d8b
Author:     James Bigler <jamesbigler at gmail.com>
AuthorDate: Wed Apr 1 17:23:51 2015 -0600
Commit:     James Bigler <jamesbigler at gmail.com>
CommitDate: Wed Apr 1 17:23:51 2015 -0600

    Add specific cuda_language_flag instead of using nvcc. Fixes bug.
    
    I was previously appending to nvcc_flags inside the file loop.  This caused the flag to be
    appended multiple times which freaks out nvcc.  Now the flag is specifically handled per
    file.

diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 99c4b30..054ffbd 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -1219,7 +1219,9 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
       endif()
       # If file isn't a .cu file, we need to tell nvcc to treat it as such.
       if(NOT ${file} MATCHES "\\.cu$")
-        list(APPEND nvcc_flags "-x=cu")
+        set(cuda_language_flag -x=cu)
+      else()
+        set(cuda_language_flag)
       endif()
 
       if( ${_cuda_source_format} MATCHES "OBJ")
diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake
index abdd307..8032309 100644
--- a/Modules/FindCUDA/run_nvcc.cmake
+++ b/Modules/FindCUDA/run_nvcc.cmake
@@ -75,6 +75,7 @@ set(CUDA_NVCC_FLAGS @CUDA_NVCC_FLAGS@ ;; @CUDA_WRAP_OPTION_NVCC_FLAGS@) # list
 set(nvcc_flags @nvcc_flags@) # list
 set(CUDA_NVCC_INCLUDE_ARGS "@CUDA_NVCC_INCLUDE_ARGS@") # list (needs to be in quotes to handle spaces properly).
 set(format_flag "@format_flag@") # string
+set(cuda_language_flag @cuda_language_flag@) # list
 
 if(build_cubin AND NOT generated_cubin_file)
   message(FATAL_ERROR "You must specify generated_cubin_file on the command line")
@@ -238,6 +239,7 @@ cuda_execute_process(
   "Generating ${generated_file}"
   COMMAND "${CUDA_NVCC_EXECUTABLE}"
   "${source_file}"
+  ${cuda_language_flag}
   ${format_flag} -o "${generated_file}"
   ${CCBIN}
   ${nvcc_flags}

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2b475cd517f9ec42e1ccd2b72edab988ab2c178d
commit 2b475cd517f9ec42e1ccd2b72edab988ab2c178d
Author:     James Bigler <jamesbigler at gmail.com>
AuthorDate: Thu Mar 26 23:46:35 2015 -0600
Commit:     James Bigler <jamesbigler at gmail.com>
CommitDate: Thu Mar 26 23:46:35 2015 -0600

    Allow setting CUDA_SOURCE_PROPERTY_FORMAT for non-.cu files.
    
    A previously undocumented feature allowed overriding the format specified to CUDA_WRAP_SRCS with a source file property called CUDA_SOURCE_PROPERTY_FORMAT.  I added documentation for this feature as well as added the ability to let nvcc compile any file regardless of type if this property was found.
    
    In addition, I also fixed a couple of bugs with the calls to _cuda_get_important_host_flags that weren't garding the arguments with "" to prevent empty values from causing errors.

diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 81e1cad..99c4b30 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -106,6 +106,12 @@
 #      CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
 #      CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called.
 #
+#   CUDA_SOURCE_PROPERTY_FORMAT
+#   -- If this source file property is set, it can override the format specified to
+#      CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN).  If an input source file is not a .cu
+#      file, setting this file will cause it to be treated as a .cu file. See
+#      documentation for set_source_files_properties on how to set this property.
+#
 #   CUDA_VERBOSE_BUILD (Default OFF)
 #   -- Set to ON to see all the commands used when building the CUDA file.  When
 #      using a Makefile generator the value defaults to VERBOSE (run make
@@ -1204,13 +1210,17 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
   foreach(file ${ARGN})
     # Ignore any file marked as a HEADER_FILE_ONLY
     get_source_file_property(_is_header ${file} HEADER_FILE_ONLY)
-    if(${file} MATCHES "\\.cu$" AND NOT _is_header)
+    # Allow per source file overrides of the format.  Also allows compiling non-.cu files.
+    get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT)
+    if((${file} MATCHES "\\.cu$" OR _cuda_source_format) AND NOT _is_header)
 
-      # Allow per source file overrides of the format.
-      get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT)
       if(NOT _cuda_source_format)
         set(_cuda_source_format ${format})
       endif()
+      # If file isn't a .cu file, we need to tell nvcc to treat it as such.
+      if(NOT ${file} MATCHES "\\.cu$")
+        list(APPEND nvcc_flags "-x=cu")
+      endif()
 
       if( ${_cuda_source_format} MATCHES "OBJ")
         set( cuda_compile_to_external_module OFF )
@@ -1223,7 +1233,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
         elseif( ${_cuda_source_format} MATCHES "FATBIN")
           set( cuda_compile_to_external_module_type "fatbin" )
         else()
-          message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS for file '${file}': '${_cuda_source_format}'.  Use OBJ, PTX, CUBIN or FATBIN.")
+          message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS or set with CUDA_SOURCE_PROPERTY_FORMAT file property for file '${file}': '${_cuda_source_format}'.  Use OBJ, PTX, CUBIN or FATBIN.")
         endif()
       endif()
 
@@ -1382,10 +1392,10 @@ endmacro()
 
 function(_cuda_get_important_host_flags important_flags flag_string)
   if(CMAKE_GENERATOR MATCHES "Visual Studio")
-    string(REGEX MATCHALL "/M[DT][d]?" flags ${flag_string})
+    string(REGEX MATCHALL "/M[DT][d]?" flags "${flag_string}")
     list(APPEND ${important_flags} ${flags})
   else()
-    string(REGEX MATCHALL "-fPIC" flags ${flag_string})
+    string(REGEX MATCHALL "-fPIC" flags "${flag_string}")
     list(APPEND ${important_flags} ${flags})
   endif()
   set(${important_flags} ${${important_flags}} PARENT_SCOPE)
@@ -1445,14 +1455,14 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
         list(APPEND config_specific_flags $<$<CONFIG:${config}>:${f}>)
       endforeach()
       set(important_host_flags)
-      _cuda_get_important_host_flags(important_host_flags ${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}})
+      _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")
       foreach(f ${important_host_flags})
         list(APPEND flags $<$<CONFIG:${config}>:-Xcompiler> $<$<CONFIG:${config}>:${f}>)
       endforeach()
     endforeach()
     # Add CMAKE_${CUDA_C_OR_CXX}_FLAGS
     set(important_host_flags)
-    _cuda_get_important_host_flags(important_host_flags ${CMAKE_${CUDA_C_OR_CXX}_FLAGS})
+    _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS}")
     foreach(f ${important_host_flags})
       list(APPEND flags -Xcompiler ${f})
     endforeach()

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

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


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list