Imported Upstream version 3.15.7 upstream/3.15.7
authorDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 8 Oct 2021 00:14:16 +0000 (09:14 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 8 Oct 2021 00:14:16 +0000 (09:14 +0900)
Modules/CMakeASM_MASMInformation.cmake
Modules/InstallRequiredSystemLibraries.cmake
Source/CMakeVersion.cmake
Source/cmLinkLineDeviceComputer.cxx
Source/cmVisualStudio10TargetGenerator.cxx
Tests/Cuda/CMakeLists.txt
Tests/Cuda/SeparableCompCXXOnly/CMakeLists.txt [new file with mode: 0644]
Tests/Cuda/SeparableCompCXXOnly/main.cpp [new file with mode: 0644]
Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc
Tests/RunCMake/FileAPI/check_index.pyc

index a38c114..9f7e934 100644 (file)
@@ -10,5 +10,11 @@ set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
 
 set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> /c  /Fo <OBJECT> <SOURCE>")
 
+# The ASM_MASM compiler id for this compiler is "MSVC", so fill out the runtime library table.
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded         "")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL      "")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug    "")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "")
+
 include(CMakeASMInformation)
 set(ASM_DIALECT)
index 0e1429d..04687b9 100644 (file)
@@ -288,9 +288,16 @@ if(MSVC)
         "${MSVC_CRT_DIR}/msvcp${v}.dll"
         )
       if(NOT vs VERSION_LESS 14)
-        if(EXISTS "${MSVC_CRT_DIR}/vcruntime${v}_1.dll")
-          list(APPEND __install__libs "${MSVC_CRT_DIR}/vcruntime${v}_1.dll")
-        endif()
+        foreach(crt
+            "${MSVC_CRT_DIR}/msvcp${v}_1.dll"
+            "${MSVC_CRT_DIR}/msvcp${v}_2.dll"
+            "${MSVC_CRT_DIR}/msvcp${v}_codecvt_ids.dll"
+            "${MSVC_CRT_DIR}/vcruntime${v}_1.dll"
+            )
+          if(EXISTS "${crt}")
+            list(APPEND __install__libs "${crt}")
+          endif()
+        endforeach()
         list(APPEND __install__libs
             "${MSVC_CRT_DIR}/vcruntime${v}.dll"
             "${MSVC_CRT_DIR}/concrt${v}.dll"
@@ -309,9 +316,16 @@ if(MSVC)
         "${MSVC_CRT_DIR}/msvcp${v}d.dll"
         )
       if(NOT vs VERSION_LESS 14)
-        if(EXISTS "${MSVC_CRT_DIR}/vcruntime${v}_1d.dll")
-          list(APPEND __install__libs "${MSVC_CRT_DIR}/vcruntime${v}_1d.dll")
-        endif()
+        foreach(crt
+            "${MSVC_CRT_DIR}/msvcp${v}_1d.dll"
+            "${MSVC_CRT_DIR}/msvcp${v}_2d.dll"
+            "${MSVC_CRT_DIR}/msvcp${v}d_codecvt_ids.dll"
+            "${MSVC_CRT_DIR}/vcruntime${v}_1d.dll"
+            )
+          if(EXISTS "${crt}")
+            list(APPEND __install__libs "${crt}")
+          endif()
+        endforeach()
         list(APPEND __install__libs
             "${MSVC_CRT_DIR}/vcruntime${v}d.dll"
             "${MSVC_CRT_DIR}/concrt${v}d.dll"
index ba06c4f..c4c4779 100644 (file)
@@ -1,5 +1,5 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 15)
-set(CMake_VERSION_PATCH 6)
+set(CMake_VERSION_PATCH 7)
 #set(CMake_VERSION_RC 0)
index 8d2add6..2cb2fd6 100644 (file)
@@ -163,33 +163,33 @@ bool requireDeviceLinking(cmGeneratorTarget& target, cmLocalGenerator& lg,
     return cmSystemTools::IsOn(resolveDeviceSymbols);
   }
 
-  if (const char* separableCompilation =
-        target.GetProperty("CUDA_SEPARABLE_COMPILATION")) {
-    if (cmSystemTools::IsOn(separableCompilation)) {
-      bool doDeviceLinking = false;
-      switch (target.GetType()) {
-        case cmStateEnums::SHARED_LIBRARY:
-        case cmStateEnums::MODULE_LIBRARY:
-        case cmStateEnums::EXECUTABLE:
-          doDeviceLinking = true;
-          break;
-        default:
-          break;
-      }
-      return doDeviceLinking;
-    }
-  }
-
   // Determine if we have any dependencies that require
   // us to do a device link step
   const std::string cuda_lang("CUDA");
   cmGeneratorTarget::LinkClosure const* closure =
     target.GetLinkClosure(config);
-
   bool closureHasCUDA =
     (std::find(closure->Languages.begin(), closure->Languages.end(),
                cuda_lang) != closure->Languages.end());
+
   if (closureHasCUDA) {
+    if (const char* separableCompilation =
+          target.GetProperty("CUDA_SEPARABLE_COMPILATION")) {
+      if (cmSystemTools::IsOn(separableCompilation)) {
+        bool doDeviceLinking = false;
+        switch (target.GetType()) {
+          case cmStateEnums::SHARED_LIBRARY:
+          case cmStateEnums::MODULE_LIBRARY:
+          case cmStateEnums::EXECUTABLE:
+            doDeviceLinking = true;
+            break;
+          default:
+            break;
+        }
+        return doDeviceLinking;
+      }
+    }
+
     cmComputeLinkInformation* pcli = target.GetLinkInformation(config);
     if (pcli) {
       cmLinkLineDeviceComputer deviceLinkComputer(
index 7a90176..fa102f8 100644 (file)
@@ -1404,6 +1404,7 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
     std::string comment = lg->ConstructComment(ccg);
     comment = cmVS10EscapeComment(comment);
     std::string script = lg->ConstructScript(ccg);
+    bool symbolic = false;
     // input files for custom command
     std::stringstream additional_inputs;
     {
@@ -1430,6 +1431,12 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
           ConvertToWindowsSlash(dep);
           additional_inputs << sep << dep;
           sep = ";";
+          if (!symbolic) {
+            if (cmSourceFile* sf = this->Makefile->GetSource(
+                  dep, cmSourceFileLocationKind::Known)) {
+              symbolic = sf->GetPropertyAsBool("SYMBOLIC");
+            }
+          }
         }
       }
       if (this->ProjectType != csproj) {
@@ -1438,7 +1445,6 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
     }
     // output files for custom command
     std::stringstream outputs;
-    bool symbolic = false;
     {
       const char* sep = "";
       for (std::string const& o : ccg.GetOutputs()) {
index a30071f..44c6005 100644 (file)
@@ -4,6 +4,7 @@ ADD_TEST_MACRO(Cuda.ConsumeCompileFeatures CudaConsumeCompileFeatures)
 ADD_TEST_MACRO(Cuda.ObjectLibrary CudaObjectLibrary)
 ADD_TEST_MACRO(Cuda.MixedStandardLevels MixedStandardLevels)
 ADD_TEST_MACRO(Cuda.NotEnabled CudaNotEnabled)
+ADD_TEST_MACRO(Cuda.SeparableCompCXXOnly SeparableCompCXXOnly)
 ADD_TEST_MACRO(Cuda.ToolkitInclude CudaToolkitInclude)
 ADD_TEST_MACRO(Cuda.ProperDeviceLibraries ProperDeviceLibraries)
 ADD_TEST_MACRO(Cuda.ProperLinkFlags ProperLinkFlags)
diff --git a/Tests/Cuda/SeparableCompCXXOnly/CMakeLists.txt b/Tests/Cuda/SeparableCompCXXOnly/CMakeLists.txt
new file mode 100644 (file)
index 0000000..97670e3
--- /dev/null
@@ -0,0 +1,3 @@
+project(SeparableCompCXXOnly LANGUAGES CXX CUDA)
+set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
+add_executable(SeparableCompCXXOnly main.cpp)
diff --git a/Tests/Cuda/SeparableCompCXXOnly/main.cpp b/Tests/Cuda/SeparableCompCXXOnly/main.cpp
new file mode 100644 (file)
index 0000000..8135246
--- /dev/null
@@ -0,0 +1,5 @@
+
+int main(int, char const* [])
+{
+  return 0;
+}
index 4983bf4..3b6cb1d 100644 (file)
Binary files a/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc and b/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc differ
index 2ab7837..1abd6c2 100644 (file)
Binary files a/Tests/RunCMake/FileAPI/check_index.pyc and b/Tests/RunCMake/FileAPI/check_index.pyc differ