summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2019-03-11 22:26:04 (GMT)
committerBartosz Kosiorek <gang65@poczta.onet.pl>2019-05-22 01:46:55 (GMT)
commit53cb1f2d04bc9ca7bd50bd3b1a60dc933eab0777 (patch)
treec0c9a75e128ad3962065264948f41c16a9d7296b /Source/cmcmd.cxx
parent0bf53483295a4b7de358e8b85ad44866d89633c5 (diff)
downloadCMake-53cb1f2d04bc9ca7bd50bd3b1a60dc933eab0777.zip
CMake-53cb1f2d04bc9ca7bd50bd3b1a60dc933eab0777.tar.gz
CMake-53cb1f2d04bc9ca7bd50bd3b1a60dc933eab0777.tar.bz2
cmake: Teach cmake -E tar command, Zstandard compression
Fixes #18657
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 3c75957..e1b6f48 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -1043,11 +1043,17 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
std::vector<std::string> files;
std::string mtime;
std::string format;
+ cmSystemTools::cmTarCompression compress =
+ cmSystemTools::TarCompressNone;
+ int nCompress = 0;
bool doing_options = true;
for (auto const& arg : cmMakeRange(args).advance(4)) {
if (doing_options && cmHasLiteralPrefix(arg, "--")) {
if (arg == "--") {
doing_options = false;
+ } else if (arg == "--zstd") {
+ compress = cmSystemTools::TarCompressZstd;
+ ++nCompress;
} else if (cmHasLiteralPrefix(arg, "--mtime=")) {
mtime = arg.substr(8);
} else if (cmHasLiteralPrefix(arg, "--files-from=")) {
@@ -1075,10 +1081,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
}
}
cmSystemTools::cmTarAction action = cmSystemTools::TarActionNone;
- cmSystemTools::cmTarCompression compress =
- cmSystemTools::TarCompressNone;
bool verbose = false;
- int nCompress = 0;
for (auto flag : flags) {
switch (flag) {