Merge topic 'elisp'

364a40025c cmake.el: enable view-mode when lookup

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jostein Kjønigsen <jostein@kjonigsen.net>
Merge-request: !5517
diff --git a/.gitlab/ci/cmake.ps1 b/.gitlab/ci/cmake.ps1
index e73aab7..9d7f317 100755
--- a/.gitlab/ci/cmake.ps1
+++ b/.gitlab/ci/cmake.ps1
@@ -1,7 +1,7 @@
 $erroractionpreference = "stop"
 
-$version = "3.18.4"
-$sha256sum = "A932BC0C8EE79F1003204466C525B38A840424D4AE29F9E5FB88959116F2407D"
+$version = "3.19.0"
+$sha256sum = "67BBDA67C98C5F0789199FE1DB650F12274A6AD40FD8CAE88D208029AC618905"
 $filename = "cmake-$version-win64-x64"
 $tarball = "$filename.zip"
 
diff --git a/.gitlab/ci/cmake.sh b/.gitlab/ci/cmake.sh
index b4c6ddf..2547663 100755
--- a/.gitlab/ci/cmake.sh
+++ b/.gitlab/ci/cmake.sh
@@ -2,17 +2,17 @@
 
 set -e
 
-readonly version="3.18.4"
+readonly version="3.19.0"
 
 case "$( uname -s )" in
     Linux)
         shatool="sha256sum"
-        sha256sum="149e0cee002e59e0bb84543cf3cb099f108c08390392605e944daeb6594cbc29"
+        sha256sum="5446cdee900e906e46162a5a7be9b4542bb5e886041cf8cffeda62aae2696ccf"
         platform="Linux"
         ;;
     Darwin)
         shatool="shasum -a 256"
-        sha256sum="9d27049660474cf134ab46fa0e0db771b263313fcb8ba82ee8b2d1a1a62f8f20"
+        sha256sum="315eb5500753f797075b6ea43189420e97b0b9f32c8fc87ec94ba1d80b72eb7f"
         platform="Darwin"
         ;;
     *)
diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml
index a500d36..db6f3bf 100644
--- a/.gitlab/os-macos.yml
+++ b/.gitlab/os-macos.yml
@@ -7,7 +7,7 @@
         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci ext/$CI_CONCURRENT_ID"
         # TODO: Factor this out so that each job selects the Xcode version to
         # use so that different versions can be tested in a single pipeline.
-        DEVELOPER_DIR: "/Applications/Xcode-11.7.app/Contents/Developer"
+        DEVELOPER_DIR: "/Applications/Xcode-12.0.app/Contents/Developer"
         # Avoid conflicting with other projects running on the same machine.
         SCCACHE_SERVER_PORT: 4227
 
@@ -63,7 +63,7 @@
         - cmake # Since this is a bare runner, pin to a project.
         - macos
         - shell
-        - xcode-11.7
+        - xcode-12.0
         - nonconcurrent
 
 .macos_builder_tags_package:
@@ -71,7 +71,7 @@
         - cmake # Since this is a bare runner, pin to a project.
         - macos
         - shell
-        - xcode-11.7
+        - xcode-12.0
         - nonconcurrent
         - finder
 
@@ -80,7 +80,7 @@
         - cmake # Since this is a bare runner, pin to a project.
         - macos
         - shell
-        - xcode-11.7
+        - xcode-12.0
         - concurrent
 
 ## macOS-specific scripts
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 6e0a944..27802f5 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 19)
-set(CMake_VERSION_PATCH 20201118)
+set(CMake_VERSION_PATCH 20201119)
 #set(CMake_VERSION_RC 0)
 set(CMake_VERSION_IS_DIRTY 0)
 
diff --git a/Source/cmScanDepFormat.cxx b/Source/cmScanDepFormat.cxx
index b157a8b..40bf4c9 100644
--- a/Source/cmScanDepFormat.cxx
+++ b/Source/cmScanDepFormat.cxx
@@ -12,25 +12,13 @@
 
 #include "cmsys/FStream.hxx"
 
-#include "cm_utf8.h"
-
 #include "cmGeneratedFileStream.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 
 static bool ParseFilename(Json::Value const& val, std::string& result)
 {
-  if (val.isObject()) {
-    Json::Value const& format = val["format"];
-    if (format == "raw8") {
-      Json::Value const& data = val["data"];
-      for (auto const& byte : data) {
-        result.push_back(static_cast<char>(byte.asUInt()));
-      }
-    } else /* TODO: if (format == "raw16") */ {
-      return false;
-    }
-  } else if (val.isString()) {
+  if (val.isString()) {
     result = val.asString();
   } else {
     return false;
@@ -41,35 +29,24 @@
 
 static Json::Value EncodeFilename(std::string const& path)
 {
-  if (cm_utf8_is_valid(path.c_str())) {
-    std::string valid_data;
-    valid_data.reserve(path.size());
+  std::string data;
+  data.reserve(path.size());
 
-    for (auto const& byte : path) {
-      if (std::iscntrl(byte)) {
-        // Control characters.
-        valid_data.append("\\u");
-        char buf[5];
-        std::snprintf(buf, sizeof(buf), "%04x", byte);
-        valid_data.append(buf);
-      } else if (byte == '"' || byte == '\\') {
-        // Special JSON characters.
-        valid_data.push_back('\\');
-        valid_data.push_back(byte);
-      } else {
-        // Other data.
-        valid_data.push_back(byte);
-      }
+  for (auto const& byte : path) {
+    if (std::iscntrl(byte)) {
+      // Control characters.
+      data.append("\\u");
+      char buf[5];
+      std::snprintf(buf, sizeof(buf), "%04x", byte);
+      data.append(buf);
+    } else if (byte == '"' || byte == '\\') {
+      // Special JSON characters.
+      data.push_back('\\');
+      data.push_back(byte);
+    } else {
+      // Other data.
+      data.push_back(byte);
     }
-
-    return valid_data;
-  }
-
-  Json::Value data;
-  data["format"] = "raw8";
-  Json::Value& code_units = data["code-units"];
-  for (auto const& code_unit : path) {
-    code_units.append(static_cast<int>(code_unit));
   }
 
   return data;
@@ -121,15 +98,6 @@
     return false;
   }
 
-  Json::Value const& workdir = ppi["work-directory"];
-  if (!workdir.isString()) {
-    cmSystemTools::Error(cmStrCat("-E cmake_ninja_depends failed to parse ",
-                                  arg_pp, ": work-directory is not a string"));
-    return false;
-  }
-  std::string work_directory;
-  PARSE_BLOB(workdir, work_directory);
-
   Json::Value const& rules = ppi["rules"];
   if (rules.isArray()) {
     if (rules.size() != 1) {
@@ -139,6 +107,16 @@
     }
 
     for (auto const& rule : rules) {
+      Json::Value const& workdir = rule["work-directory"];
+      if (!workdir.isString()) {
+        cmSystemTools::Error(
+          cmStrCat("-E cmake_ninja_depends failed to parse ", arg_pp,
+                   ": work-directory is not a string"));
+        return false;
+      }
+      std::string work_directory;
+      PARSE_BLOB(workdir, work_directory);
+
       Json::Value const& depends = rule["depends"];
       if (depends.isArray()) {
         std::string depend_filename;
@@ -223,12 +201,12 @@
   Json::Value ddi(Json::objectValue);
   ddi["version"] = 0;
   ddi["revision"] = 0;
-  ddi["work-directory"] =
-    EncodeFilename(cmSystemTools::GetCurrentWorkingDirectory());
 
   Json::Value& rules = ddi["rules"] = Json::arrayValue;
 
   Json::Value rule(Json::objectValue);
+  rule["work-directory"] =
+    EncodeFilename(cmSystemTools::GetCurrentWorkingDirectory());
   Json::Value& inputs = rule["inputs"] = Json::arrayValue;
   inputs.append(EncodeFilename(input));