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  0780a8f57ac6a593a53fe2fe9ce22c889a77d5fb (commit)
       via  3542a553bf5149734c9002952795026ffbd06308 (commit)
       via  7b7421346194896109a304ff088630f37ab2bd9e (commit)
       via  014a098479bbe091b47d20c070fb05bc362723c7 (commit)
       via  cbc772b89d94d5c02c8739d4b428a3de52f4091b (commit)
      from  d8c6427fa158a96a2e41f07d60c924cee94e413b (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=0780a8f57ac6a593a53fe2fe9ce22c889a77d5fb
commit 0780a8f57ac6a593a53fe2fe9ce22c889a77d5fb
Merge: 3542a55 7b74213
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Thu Dec 6 13:38:45 2018 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Thu Dec 6 08:39:22 2018 -0500

    Merge topic 'cuda-external'
    
    7b74213461 CUDA: Fix crash on linking to a CUDA target without CUDA enabled
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !2704


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3542a553bf5149734c9002952795026ffbd06308
commit 3542a553bf5149734c9002952795026ffbd06308
Merge: d8c6427 014a098
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Thu Dec 6 13:38:17 2018 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Thu Dec 6 08:38:23 2018 -0500

    Merge topic 'update-kwsys'
    
    014a098479 Merge branch 'upstream-KWSys' into update-kwsys
    cbc772b89d KWSys 2018-11-28 (5ea12a52)
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Acked-by: Isaiah <isaiah.nor...@gmail.com>
    Merge-request: !2678


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b7421346194896109a304ff088630f37ab2bd9e
commit 7b7421346194896109a304ff088630f37ab2bd9e
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed Dec 5 11:57:47 2018 -0500
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Dec 5 14:45:19 2018 -0500

    CUDA: Fix crash on linking to a CUDA target without CUDA enabled
    
    Do not try to device link or add CUDA runtime libraries if the language
    is not enabled.
    
    Fixes: #18673
    Issue: #18614

diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx 
b/Source/cmMakefileExecutableTargetGenerator.cxx
index 08bb2ce..846b12c 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -84,6 +84,10 @@ void 
cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule(
   bool relink)
 {
 #ifdef CMAKE_BUILD_WITH_CMAKE
+  if (!this->GlobalGenerator->GetLanguageEnabled("CUDA")) {
+    return;
+  }
+
   const std::string cuda_lang("CUDA");
   cmGeneratorTarget::LinkClosure const* closure =
     this->GeneratorTarget->GetLinkClosure(this->ConfigName);
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx 
b/Source/cmNinjaNormalTargetGenerator.cxx
index 6436969..8909e06 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -558,6 +558,10 @@ std::vector<std::string> 
cmNinjaNormalTargetGenerator::ComputeLinkCmd()
 
 void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
 {
+  if (!this->GetGlobalGenerator()->GetLanguageEnabled("CUDA")) {
+    return;
+  }
+
   cmGeneratorTarget& genTarget = *this->GetGeneratorTarget();
 
   // determine if we need to do any device linking for this target
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx 
b/Source/cmVisualStudio10TargetGenerator.cxx
index 334c15b..d5e834b 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -3331,7 +3331,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
   std::vector<std::string> vsTargetVec;
   this->AddLibraries(cli, libVec, vsTargetVec, config);
   if (std::find(linkClosure->Languages.begin(), linkClosure->Languages.end(),
-                "CUDA") != linkClosure->Languages.end()) {
+                "CUDA") != linkClosure->Languages.end() &&
+      this->CudaOptions[config] != nullptr) {
     switch (this->CudaOptions[config]->GetCudaRuntime()) {
       case cmVisualStudioGeneratorOptions::CudaRuntimeStatic:
         libVec.push_back("cudadevrt.lib");
diff --git a/Tests/RunCMake/Languages/ExternalCUDA.cmake 
b/Tests/RunCMake/Languages/ExternalCUDA.cmake
new file mode 100644
index 0000000..3afa93e
--- /dev/null
+++ b/Tests/RunCMake/Languages/ExternalCUDA.cmake
@@ -0,0 +1,8 @@
+enable_language(C)
+
+add_library(ext_cuda IMPORTED STATIC)
+set_property(TARGET ext_cuda PROPERTY IMPORTED_LOCATION "/does_not_exist")
+set_property(TARGET ext_cuda PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CUDA")
+
+add_executable(main empty.c)
+target_link_libraries(main ext_cuda)
diff --git a/Tests/RunCMake/Languages/RunCMakeTest.cmake 
b/Tests/RunCMake/Languages/RunCMakeTest.cmake
index 732baae..2a534b3 100644
--- a/Tests/RunCMake/Languages/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Languages/RunCMakeTest.cmake
@@ -6,3 +6,5 @@ run_cmake(link-libraries-TARGET_FILE-genex)
 run_cmake(link-libraries-TARGET_FILE-genex-ok)
 
 run_cmake(DetermineFail)
+
+run_cmake(ExternalCUDA)
diff --git a/Tests/RunCMake/Languages/empty.c b/Tests/RunCMake/Languages/empty.c
new file mode 100644
index 0000000..e69de29

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=014a098479bbe091b47d20c070fb05bc362723c7
commit 014a098479bbe091b47d20c070fb05bc362723c7
Merge: 18b9cf4 cbc772b
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed Nov 28 08:56:00 2018 -0500
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Nov 28 08:56:00 2018 -0500

    Merge branch 'upstream-KWSys' into update-kwsys
    
    * upstream-KWSys:
      KWSys 2018-11-28 (5ea12a52)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cbc772b89d94d5c02c8739d4b428a3de52f4091b
commit cbc772b89d94d5c02c8739d4b428a3de52f4091b
Author:     KWSys Upstream <kwro...@kitware.com>
AuthorDate: Wed Nov 28 07:11:04 2018 -0500
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Nov 28 08:56:00 2018 -0500

    KWSys 2018-11-28 (5ea12a52)
    
    Code extracted from:
    
        https://gitlab.kitware.com/utils/kwsys.git
    
    at commit 5ea12a52b24248041adf49421a43df649530fc23 (master).
    
    Upstream Shortlog
    -----------------
    
    Isaiah Norton (1):
          4f9fb9aa SystemTools: Fix Touch to avoid requiring file ownership

diff --git a/SystemTools.cxx b/SystemTools.cxx
index 0a4ad7a..331f16e 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -1355,39 +1355,15 @@ bool SystemTools::Touch(const std::string& filename, 
bool create)
   }
   CloseHandle(h);
 #elif KWSYS_CXX_HAS_UTIMENSAT
-  struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
-  if (utimensat(AT_FDCWD, filename.c_str(), times, 0) < 0) {
+  // utimensat is only available on newer Unixes and macOS 10.13+
+  if (utimensat(AT_FDCWD, filename.c_str(), NULL, 0) < 0) {
     return false;
   }
 #else
-  struct stat st;
-  if (stat(filename.c_str(), &st) < 0) {
-    return false;
-  }
-  struct timeval mtime;
-  gettimeofday(&mtime, 0);
-#  if KWSYS_CXX_HAS_UTIMES
-  struct timeval atime;
-#    if KWSYS_CXX_STAT_HAS_ST_MTIM
-  atime.tv_sec = st.st_atim.tv_sec;
-  atime.tv_usec = st.st_atim.tv_nsec / 1000;
-#    elif KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
-  atime.tv_sec = st.st_atimespec.tv_sec;
-  atime.tv_usec = st.st_atimespec.tv_nsec / 1000;
-#    else
-  atime.tv_sec = st.st_atime;
-  atime.tv_usec = 0;
-#    endif
-  struct timeval times[2] = { atime, mtime };
-  if (utimes(filename.c_str(), times) < 0) {
+  // fall back to utimes
+  if (utimes(filename.c_str(), NULL) < 0) {
     return false;
   }
-#  else
-  struct utimbuf times = { st.st_atime, mtime.tv_sec };
-  if (utime(filename.c_str(), &times) < 0) {
-    return false;
-  }
-#  endif
 #endif
   return true;
 }

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

Summary of changes:
 Source/cmMakefileExecutableTargetGenerator.cxx     |  4 +++
 Source/cmNinjaNormalTargetGenerator.cxx            |  4 +++
 Source/cmVisualStudio10TargetGenerator.cxx         |  3 +-
 Source/kwsys/SystemTools.cxx                       | 32 +++-------------------
 Tests/RunCMake/Languages/ExternalCUDA.cmake        |  8 ++++++
 Tests/RunCMake/Languages/RunCMakeTest.cmake        |  2 ++
 .../{target_link_libraries => Languages}/empty.c   |  0
 7 files changed, 24 insertions(+), 29 deletions(-)
 create mode 100644 Tests/RunCMake/Languages/ExternalCUDA.cmake
 copy Tests/RunCMake/{target_link_libraries => Languages}/empty.c (100%)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits

Reply via email to