[Cmake-commits] CMake branch, master, updated. v3.11.0-rc4-289-g948eb3b

Kitware Robot kwrobot at kitware.com
Wed Mar 21 09:15:04 EDT 2018


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, master has been updated
       via  948eb3b2bf450d9c1a562af9cb2f9cc188a9ec6a (commit)
       via  54ae5ee1d3d52ed685a707e1bcab64b0d93d070f (commit)
       via  87223a24f061c519caf72df63e61be9676e322ea (commit)
       via  e743fc8e9137692232f0220ac901f5a15cbd62cf (commit)
       via  3af1daa186f01f1538cf9a7541e9269ac0c6e95a (commit)
       via  8c0f12c4aa4d3b6a83ea663f27d1affed61abcf6 (commit)
      from  64bb65777ad011d96c6bedca36b24df7d9a1371d (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=948eb3b2bf450d9c1a562af9cb2f9cc188a9ec6a
commit 948eb3b2bf450d9c1a562af9cb2f9cc188a9ec6a
Merge: 54ae5ee e743fc8
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Mar 21 13:10:37 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Mar 21 09:10:46 2018 -0400

    Merge topic 'cuda_arch'
    
    e743fc8e91 FindCUDA/select_compute_arch: Add support for CUDA as a language
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1856


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=54ae5ee1d3d52ed685a707e1bcab64b0d93d070f
commit 54ae5ee1d3d52ed685a707e1bcab64b0d93d070f
Merge: 87223a2 3af1daa
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Mar 21 13:08:48 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Mar 21 09:08:58 2018 -0400

    Merge topic 'pr.target_compile_definitions'
    
    3af1daa186 Help: Document target_compile_definitions handling of -D
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1873


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=87223a24f061c519caf72df63e61be9676e322ea
commit 87223a24f061c519caf72df63e61be9676e322ea
Merge: 64bb657 8c0f12c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Mar 21 13:08:01 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Mar 21 09:08:10 2018 -0400

    Merge topic 'makefile-fix-depend-optimization'
    
    8c0f12c4aa Makefile: Restore use of dependency scanning cache
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1870


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e743fc8e9137692232f0220ac901f5a15cbd62cf
commit e743fc8e9137692232f0220ac901f5a15cbd62cf
Author:     Henry Fredrick Schreiner <henry.fredrick.schreiner at cern.ch>
AuthorDate: Thu Mar 15 15:30:50 2018 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Mar 20 14:19:25 2018 -0400

    FindCUDA/select_compute_arch: Add support for CUDA as a language
    
    Even though this is an internal module, we can still prepare it to
    be used in another public-facing module outside of `FindCUDA`.
    
    Issue: #16586

diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake
index b604a17..2a196c2 100644
--- a/Modules/FindCUDA/select_compute_arch.cmake
+++ b/Modules/FindCUDA/select_compute_arch.cmake
@@ -23,6 +23,12 @@ set(CUDA_KNOWN_GPU_ARCHITECTURES  "Fermi" "Kepler" "Maxwell")
 # This list will be used for CUDA_ARCH_NAME = Common option (enabled by default)
 set(CUDA_COMMON_GPU_ARCHITECTURES "3.0" "3.5" "5.0")
 
+if(CMAKE_CUDA_COMPILER_LOADED) # CUDA as a language
+  if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
+    set(CUDA_VERSION "${CMAKE_CUDA_COMPILER_VERSION}")
+  endif()
+endif()
+
 if (CUDA_VERSION VERSION_GREATER "6.5")
   list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Kepler+Tegra" "Kepler+Tesla" "Maxwell+Tegra")
   list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "5.2")
@@ -49,7 +55,11 @@ endif()
 #
 function(CUDA_DETECT_INSTALLED_GPUS OUT_VARIABLE)
   if(NOT CUDA_GPU_DETECT_OUTPUT)
-    set(file ${PROJECT_BINARY_DIR}/detect_cuda_compute_capabilities.cpp)
+    if(CMAKE_CUDA_COMPILER_LOADED) # CUDA as a language
+      set(file "${PROJECT_BINARY_DIR}/detect_cuda_compute_capabilities.cu")
+    else()
+      set(file "${PROJECT_BINARY_DIR}/detect_cuda_compute_capabilities.cpp")
+    endif()
 
     file(WRITE ${file} ""
       "#include <cuda_runtime.h>\n"
@@ -68,10 +78,15 @@ function(CUDA_DETECT_INSTALLED_GPUS OUT_VARIABLE)
       "  return 0;\n"
       "}\n")
 
-    try_run(run_result compile_result ${PROJECT_BINARY_DIR} ${file}
-            CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CUDA_INCLUDE_DIRS}"
-            LINK_LIBRARIES ${CUDA_LIBRARIES}
-            RUN_OUTPUT_VARIABLE compute_capabilities)
+    if(CMAKE_CUDA_COMPILER_LOADED) # CUDA as a language
+      try_run(run_result compile_result ${PROJECT_BINARY_DIR} ${file}
+              RUN_OUTPUT_VARIABLE compute_capabilities)
+    else()
+      try_run(run_result compile_result ${PROJECT_BINARY_DIR} ${file}
+              CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CUDA_INCLUDE_DIRS}"
+              LINK_LIBRARIES ${CUDA_LIBRARIES}
+              RUN_OUTPUT_VARIABLE compute_capabilities)
+    endif()
 
     if(run_result EQUAL 0)
       string(REPLACE "2.1" "2.1(2.0)" compute_capabilities "${compute_capabilities}")

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3af1daa186f01f1538cf9a7541e9269ac0c6e95a
commit 3af1daa186f01f1538cf9a7541e9269ac0c6e95a
Author:     Ruslan Baratov <ruslan_baratov at yahoo.com>
AuthorDate: Tue Mar 20 17:13:41 2018 +0300
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Mar 20 14:06:15 2018 -0400

    Help: Document target_compile_definitions handling of -D
    
    Add an example of using the `target_compile_definitions` command and a
    note about usage of ``-D`` in items.

diff --git a/Help/command/target_compile_definitions.rst b/Help/command/target_compile_definitions.rst
index 3709e7a..a740117 100644
--- a/Help/command/target_compile_definitions.rst
+++ b/Help/command/target_compile_definitions.rst
@@ -27,3 +27,13 @@ Arguments to ``target_compile_definitions`` may use "generator expressions"
 with the syntax ``$<...>``.  See the :manual:`cmake-generator-expressions(7)`
 manual for available expressions.  See the :manual:`cmake-buildsystem(7)`
 manual for more on defining buildsystem properties.
+
+Any leading ``-D`` on an item will be removed.  Empty items are ignored.
+For example, the following are all equivalent:
+
+.. code-block:: cmake
+
+  target_compile_definitions(foo PUBLIC FOO)
+  target_compile_definitions(foo PUBLIC -DFOO)  # -D removed
+  target_compile_definitions(foo PUBLIC "" FOO) # "" ignored
+  target_compile_definitions(foo PUBLIC -D FOO) # -D becomes "", then ignored

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c0f12c4aa4d3b6a83ea663f27d1affed61abcf6
commit 8c0f12c4aa4d3b6a83ea663f27d1affed61abcf6
Author:     tsecer harry <tsecer at 163.com>
AuthorDate: Tue Mar 20 15:59:00 2018 +0800
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Mar 20 08:40:04 2018 -0400

    Makefile: Restore use of dependency scanning cache
    
    Since commit v2.8.0~27 (Major optimization of C/C++ dependency scanning,
    2009-09-23) our `VaildDeps` cache of `depend.internal` content is
    supposed to avoid re-scanning dependencies of object files whose
    dependencies have not changed.  However, this was broken by changes to
    `cmDependsC::WriteDependencies` by commit v3.1.0-rc1~272^2~1 (cmDepends:
    Refactor object file path conversion, 2014-07-22).  The object file path
    written to `depend.internal` was changed to a relative path, but the
    lookup in the `ValidDeps` cache of that information was not updated too.
    Therefore the cache is not used.
    
    Fix the object file path used for the `ValidDeps` lookup to restore the
    original optimization.

diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index 62bc8d9..34c0e94 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -96,9 +96,16 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
   std::set<std::string> dependencies;
   bool haveDeps = false;
 
+  std::string binDir = this->LocalGenerator->GetBinaryDirectory();
+
+  // Compute a path to the object file to write to the internal depend file.
+  // Any existing content of the internal depend file has already been
+  // loaded in ValidDeps with this path as a key.
+  std::string obj_i = this->LocalGenerator->ConvertToRelativePath(binDir, obj);
+
   if (this->ValidDeps != nullptr) {
     std::map<std::string, DependencyVector>::const_iterator tmpIt =
-      this->ValidDeps->find(obj);
+      this->ValidDeps->find(obj_i);
     if (tmpIt != this->ValidDeps->end()) {
       dependencies.insert(tmpIt->second.begin(), tmpIt->second.end());
       haveDeps = true;
@@ -222,8 +229,6 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
   // written by the original local generator for this directory
   // convert the dependencies to paths relative to the home output
   // directory.  We must do the same here.
-  std::string binDir = this->LocalGenerator->GetBinaryDirectory();
-  std::string obj_i = this->LocalGenerator->ConvertToRelativePath(binDir, obj);
   std::string obj_m = cmSystemTools::ConvertToOutputPath(obj_i);
   internalDepends << obj_i << std::endl;
 

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

Summary of changes:
 Help/command/target_compile_definitions.rst |   10 ++++++++++
 Modules/FindCUDA/select_compute_arch.cmake  |   25 ++++++++++++++++++++-----
 Source/cmDependsC.cxx                       |   11 ++++++++---
 3 files changed, 38 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list