Imported Upstream version 3.16.4 1d6613f4446f69f63beddf2d97c201154fb35e33
authorDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 8 Oct 2021 00:19:17 +0000 (09:19 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 8 Oct 2021 00:19:17 +0000 (09:19 +0900)
17 files changed:
Modules/CMakeASM_MASMInformation.cmake
Modules/CPack.cmake
Modules/FindMPI.cmake
Modules/Internal/CPack/CPackDeb.cmake
Modules/Platform/AIX-XL.cmake
Modules/Platform/Android/Determine-Compiler-NDK.cmake
Source/CMakeVersion.cmake
Source/cmFileCommand.cxx
Source/cmGlobalVisualStudio10Generator.cxx
Source/cmGlobalVisualStudio10Generator.h
Source/cmVisualStudio10TargetGenerator.cxx
Tests/RunCMake/CPack/RunCMakeTest.cmake
Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/VerifyResult.cmake
Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/test.cmake
Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake
Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt
Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake

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 a1cc71d..c2ed3de 100644 (file)
@@ -458,12 +458,13 @@ if(NOT DEFINED CPACK_PACKAGE_VERSION)
 endif()
 
 _cpack_set_default(CPACK_PACKAGE_VENDOR "Humanity")
+set(CPACK_DEFAULT_PACKAGE_DESCRIPTION_SUMMARY "${CMAKE_PROJECT_NAME} built using CMake")
 if(CMAKE_PROJECT_DESCRIPTION)
   _cpack_set_default(CPACK_PACKAGE_DESCRIPTION_SUMMARY
     "${CMAKE_PROJECT_DESCRIPTION}")
 else()
   _cpack_set_default(CPACK_PACKAGE_DESCRIPTION_SUMMARY
-    "${CMAKE_PROJECT_NAME} built using CMake")
+    "${CPACK_DEFAULT_PACKAGE_DESCRIPTION_SUMMARY}")
 endif()
 if(CMAKE_PROJECT_HOMEPAGE_URL)
   _cpack_set_default(CPACK_PACKAGE_HOMEPAGE_URL
index 2779032..d6cd799 100644 (file)
@@ -96,15 +96,27 @@ For running MPI programs, the module sets the following variables
 Variables for locating MPI
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-This module performs a three step search for an MPI implementation:
+This module performs a four step search for an MPI implementation:
 
-1. Check if the compiler has MPI support built-in. This is the case if the user passed a
+1. Search for ``MPIEXEC_EXECUTABLE`` and, if found, use its base directory.
+2. Check if the compiler has MPI support built-in. This is the case if the user passed a
    compiler wrapper as ``CMAKE_<LANG>_COMPILER`` or if they're on a Cray system.
-2. Attempt to find an MPI compiler wrapper and determine the compiler information from it.
-3. Try to find an MPI implementation that does not ship such a wrapper by guessing settings.
+3. Attempt to find an MPI compiler wrapper and determine the compiler information from it.
+4. Try to find an MPI implementation that does not ship such a wrapper by guessing settings.
    Currently, only Microsoft MPI and MPICH2 on Windows are supported.
 
-For controlling the second step, the following variables may be set:
+For controlling the ``MPIEXEC_EXECUTABLE`` step, the following variables may be set:
+
+``MPIEXEC_EXECUTABLE``
+  Manually specify the location of ``mpiexec``.
+``MPI_HOME``
+  Specify the base directory of the MPI installation.
+``ENV{MPI_HOME}``
+  Environment variable to specify the base directory of the MPI installation.
+``ENV{I_MPI_ROOT}``
+  Environment variable to specify the base directory of the MPI installation.
+
+For controlling the compiler wrapper step, the following variables may be set:
 
 ``MPI_<lang>_COMPILER``
   Search for the specified compiler wrapper and use it.
index 3927b1a..97906ca 100644 (file)
@@ -540,7 +540,8 @@ function(cpack_deb_prepare_package_vars)
   # Ok, description has set. According to the `Debian Policy Manual`_ the frist
   # line is a pacakge summary.  Try to get it as well...
   # See also: https://www.debian.org/doc/debian-policy/ch-controlfields.html#description
-  elseif(CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+  elseif(CPACK_PACKAGE_DESCRIPTION_SUMMARY AND
+         NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY STREQUAL CPACK_DEFAULT_PACKAGE_DESCRIPTION_SUMMARY)
     # Merge summary w/ the detailed description
     string(PREPEND CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}\n")
   endif()
index 64b0bc1..2a67c4f 100644 (file)
@@ -18,14 +18,24 @@ macro(__aix_compiler_xl lang)
 
   set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath")
 
+  set(_OBJECTS " <OBJECTS>")
+  if(DEFINED CMAKE_XL_CreateExportList AND CMAKE_XL_CreateExportList STREQUAL "")
+    # Prior to CMake 3.16, CMAKE_XL_CreateExportList held the path to the XL CreateExportList tool.
+    # Users could set it to an empty value to skip automatic exports in favor of manual -bE: flags.
+    # Preserve that behavior for compatibility (even though it was undocumented).
+    set(_OBJECTS "")
+  endif()
+
   # Construct the export list ourselves to pass only the object files so
   # that we export only the symbols actually provided by the sources.
   set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
-    "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/objects.exp <OBJECTS>"
+    "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/objects.exp${_OBJECTS}"
     "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
     )
 
   set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS
     "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <TARGET_IMPLIB> -l . <OBJECTS>"
     "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> -Wl,-bE:<TARGET_IMPLIB> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+
+  unset(_OBJECTS)
 endmacro()
index e009c10..f56e1d5 100644 (file)
@@ -23,6 +23,7 @@ if(CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED)
   set(_ANDROID_TOOL_CXX_COMPILER_EXTERNAL_TOOLCHAIN "")
   set(_ANDROID_TOOL_CXX_TOOLCHAIN_PREFIX "${CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED}/bin/${CMAKE_ANDROID_ARCH_TRIPLE}-")
   set(_ANDROID_TOOL_CXX_TOOLCHAIN_SUFFIX "${_ANDROID_HOST_EXT}")
+  set(_CMAKE_TOOLCHAIN_PREFIX "${CMAKE_ANDROID_ARCH_TRIPLE}-")
   return()
 endif()
 
index 889e943..2797a65 100644 (file)
@@ -1,7 +1,7 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 16)
-set(CMake_VERSION_PATCH 3)
+set(CMake_VERSION_PATCH 4)
 #set(CMake_VERSION_RC 0)
 set(CMake_VERSION_IS_DIRTY 0)
 
@@ -21,7 +21,7 @@ endif()
 
 if(NOT CMake_VERSION_NO_GIT)
   # If this source was exported by 'git archive', use its commit info.
-  set(git_info [==[21e60da5bb CMake 3.16.3]==])
+  set(git_info [==[44b8937b76 CMake 3.16.4]==])
 
   # Otherwise, try to identify the current development source version.
   if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* "
index d55b959..d45414f 100644 (file)
@@ -2673,9 +2673,20 @@ bool HandleGetRuntimeDependenciesCommand(std::vector<std::string> const& args,
     cmSystemTools::SetFatalErrorOccured();
     return false;
   }
-  argIt = keywordsMissingValues.begin();
-  if (argIt != keywordsMissingValues.end()) {
-    status.SetError(cmStrCat("Keyword missing value: ", *argIt));
+
+  const std::vector<std::string> LIST_ARGS = { "DIRECTORIES",
+                                               "EXECUTABLES",
+                                               "LIBRARIES",
+                                               "MODULES",
+                                               "POST_EXCLUDE_REGEXES",
+                                               "POST_INCLUDE_REGEXES",
+                                               "PRE_EXCLUDE_REGEXES",
+                                               "PRE_INCLUDE_REGEXES" };
+  auto kwbegin = keywordsMissingValues.cbegin();
+  auto kwend = cmRemoveMatching(keywordsMissingValues, LIST_ARGS);
+  if (kwend != kwbegin) {
+    status.SetError(cmStrCat("Keywords missing values:\n  ",
+                             cmJoin(cmMakeRange(kwbegin, kwend), "\n  ")));
     cmSystemTools::SetFatalErrorOccured();
     return false;
   }
index 09a49e1..f6472ab 100644 (file)
@@ -230,6 +230,12 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
     }
   }
 
+  this->SupportsUnityBuilds =
+    this->Version >= cmGlobalVisualStudioGenerator::VS16 ||
+    (this->Version == cmGlobalVisualStudioGenerator::VS15 &&
+     cmSystemTools::PathExists(this->VCTargetsPath +
+                               "/Microsoft.Cpp.Unity.targets"));
+
   if (this->GeneratorToolsetCuda.empty()) {
     // Find the highest available version of the CUDA tools.
     std::vector<std::string> cudaTools;
index 9adcf08..56f1193 100644 (file)
@@ -108,6 +108,8 @@ public:
   virtual bool IsDefaultToolset(const std::string& version) const;
   virtual std::string GetAuxiliaryToolset() const;
 
+  bool GetSupportsUnityBuilds() const { return this->SupportsUnityBuilds; }
+
   bool FindMakeProgram(cmMakefile* mf) override;
 
   bool IsIPOSupported() const override { return true; }
@@ -172,6 +174,7 @@ protected:
   std::string DefaultMasmFlagTableName;
   std::string DefaultNasmFlagTableName;
   std::string DefaultRCFlagTableName;
+  bool SupportsUnityBuilds = false;
   bool SystemIsWindowsCE;
   bool SystemIsWindowsPhone;
   bool SystemIsWindowsStore;
index 53fc93c..5857477 100644 (file)
@@ -1430,6 +1430,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;
     {
@@ -1456,6 +1457,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) {
@@ -1464,7 +1471,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()) {
@@ -2085,9 +2091,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
   const bool haveUnityBuild =
     this->GeneratorTarget->GetPropertyAsBool("UNITY_BUILD");
 
-  if (haveUnityBuild &&
-      this->GlobalGenerator->GetVersion() >=
-        cmGlobalVisualStudioGenerator::VS15) {
+  if (haveUnityBuild && this->GlobalGenerator->GetSupportsUnityBuilds()) {
     Elem e1(e0, "PropertyGroup");
     e1.Element("EnableUnitySupport", "true");
   }
@@ -2193,9 +2197,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
       this->WriteSource(e2, si.Source);
 
       bool useNativeUnityBuild = false;
-      if (haveUnityBuild &&
-          this->GlobalGenerator->GetVersion() >=
-            cmGlobalVisualStudioGenerator::VS15) {
+      if (haveUnityBuild && this->GlobalGenerator->GetSupportsUnityBuilds()) {
         // Magic value taken from cmGlobalVisualStudioVersionedGenerator.cxx
         static const std::string vs15 = "141";
         std::string toolset =
@@ -2222,7 +2224,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
             si.Source->GetProperty("UNITY_SOURCE_FILE"));
           e2.Attribute("UnityFilesDirectory", unityDir);
         } else {
-          // Visual Studio versions prior to 2017 do not know about unity
+          // Visual Studio versions prior to 2017 15.8 do not know about unity
           // builds, thus we exclude the files alredy part of unity sources.
           if (!si.Source->GetPropertyAsBool("SKIP_UNITY_BUILD_INCLUSION")) {
             exclude_configs = si.Configs;
index 745bc8a..c2382b0 100644 (file)
@@ -38,7 +38,7 @@ run_cpack_test(DEB_PACKAGE_VERSION_BACK_COMPATIBILITY "DEB.DEB_PACKAGE_VERSION_B
 run_cpack_test_subtests(EXTERNAL "none;good;good_multi;bad_major;bad_minor;invalid_good;invalid_bad;stage_and_package" "External" false "MONOLITHIC;COMPONENT")
 run_cpack_test_subtests(
   DEB_DESCRIPTION
-  "CPACK_DEBIAN_PACKAGE_DESCRIPTION;CPACK_PACKAGE_DESCRIPTION;CPACK_PACKAGE_DESCRIPTION_FILE;CPACK_NO_PACKAGE_DESCRIPTION"
+  "CPACK_DEBIAN_PACKAGE_DESCRIPTION;CPACK_PACKAGE_DESCRIPTION;CPACK_COMPONENT_COMP_DESCRIPTION;CPACK_PACKAGE_DESCRIPTION_FILE;CPACK_NO_PACKAGE_DESCRIPTION"
   "DEB.DEB_DESCRIPTION"
   false
   "MONOLITHIC;COMPONENT"
index a8e2e7a..bfe2059 100644 (file)
@@ -58,6 +58,8 @@ if(RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_PACKAGE_DESCRIPTION_FILE" AND PACKAGI
   string(APPEND _expected_description "\n  ." )
 elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_NO_PACKAGE_DESCRIPTION")
   set(_expected_description [[ Description: This is the summary line]])
+elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_COMPONENT_COMP_DESCRIPTION")
+  set(_expected_description [[ Description: One line description]])
 endif()
 
 foreach(_file_no RANGE 1 ${EXPECTED_FILES_COUNT})
index ce3f651..893eb01 100644 (file)
@@ -34,6 +34,16 @@ elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_PACKAGE_DESCRIPTION")
     set(CPACK_PACKAGE_DESCRIPTION "${_description}")
   endif()
 
+elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_COMPONENT_COMP_DESCRIPTION")
+  # NOTE Documented fallback variable without CPACK_PACKAGE_DESCRIPTION_SUMMARY
+  if(PACKAGING_TYPE STREQUAL "COMPONENT")
+    set(CPACK_COMPONENT_SATU_DESCRIPTION "One line description")
+    set(CPACK_COMPONENT_DUA_DESCRIPTION "One line description")
+  else()
+    set(CPACK_PACKAGE_DESCRIPTION "One line description")
+  endif()
+  unset(CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+
 elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_PACKAGE_DESCRIPTION_FILE")
   # NOTE Getting the description from the file
   set(_file "${CMAKE_CURRENT_BINARY_DIR}/description.txt")
index c47b40e..b4bdb61 100644 (file)
@@ -8,9 +8,6 @@ endfunction()
 if(GENERATOR_TYPE STREQUAL "DEB")
   set(name_ "Package")
   set(group_ "Section")
-  # NOTE For a Debian package the first line of the `Description`
-  # field is generated by CMake and gonna be ignored
-  set(ignore_rest_cond_ ".*\n")
 elseif(GENERATOR_TYPE STREQUAL "RPM")
   set(name_ "Name")
   set(group_ "Group")
@@ -36,6 +33,6 @@ if(GENERATOR_TYPE STREQUAL "RPM")
 endif()
 
 # check package description
-checkPackageInfo_("description" "${FOUND_FILE_1}" ".*Description${whitespaces_}:${ignore_rest_cond_}${whitespaces_}Description for pkg_1")
-checkPackageInfo_("description" "${FOUND_FILE_2}" ".*Description${whitespaces_}:${ignore_rest_cond_}${whitespaces_}Description for pkg_2")
-checkPackageInfo_("description" "${FOUND_FILE_3}" ".*Description${whitespaces_}:${ignore_rest_cond_}${whitespaces_}Description for pkg_3")
+checkPackageInfo_("description" "${FOUND_FILE_1}" ".*Description${whitespaces_}:${whitespaces_}Description for pkg_1")
+checkPackageInfo_("description" "${FOUND_FILE_2}" ".*Description${whitespaces_}:${whitespaces_}Description for pkg_2")
+checkPackageInfo_("description" "${FOUND_FILE_3}" ".*Description${whitespaces_}:${whitespaces_}Description for pkg_3")
index 94f0f46..50fa81f 100644 (file)
@@ -13,6 +13,11 @@ Call Stack \(most recent call first\):
 This warning is for project developers\.  Use -Wno-dev to suppress it\.
 
 CMake Error at file-GET_RUNTIME_DEPENDENCIES-badargs2\.cmake:[0-9]+ \(file\):
-  file Keyword missing value: BUNDLE_EXECUTABLE
+  file Keywords missing values:
+
+    RESOLVED_DEPENDENCIES_VAR
+    UNRESOLVED_DEPENDENCIES_VAR
+    CONFLICTING_DEPENDENCIES_PREFIX
+    BUNDLE_EXECUTABLE
 Call Stack \(most recent call first\):
   CMakeLists\.txt:[0-9]+ \(include\)$
index 138ab95..ac6af85 100644 (file)
@@ -1,2 +1,15 @@
-file(GET_RUNTIME_DEPENDENCIES BUNDLE_EXECUTABLE)
+file(GET_RUNTIME_DEPENDENCIES
+  RESOLVED_DEPENDENCIES_VAR
+  UNRESOLVED_DEPENDENCIES_VAR
+  CONFLICTING_DEPENDENCIES_PREFIX
+  BUNDLE_EXECUTABLE
+  EXECUTABLES
+  LIBRARIES
+  MODULES
+  DIRECTORIES
+  PRE_INCLUDE_REGEXES
+  PRE_EXCLUDE_REGEXES
+  POST_INCLUDE_REGEXES
+  POST_EXCLUDE_REGEXES
+  )
 message(FATAL_ERROR "This message should not be displayed")