summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-05-16 15:31:26 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-05-16 16:47:50 (GMT)
commitd6c0e827bc0f49ee6aa6deb5c0ee3838475fe3fe (patch)
tree7129c1e89773603e1c805937a1d7e76f8ab743af /Source/cmGlobalGenerator.cxx
parent28ee3bef3467bb05f9ca4fa74c51e566177ad1c9 (diff)
downloadCMake-d6c0e827bc0f49ee6aa6deb5c0ee3838475fe3fe.zip
CMake-d6c0e827bc0f49ee6aa6deb5c0ee3838475fe3fe.tar.gz
CMake-d6c0e827bc0f49ee6aa6deb5c0ee3838475fe3fe.tar.bz2
cmGlobalGenerator: add a `QuotedPrintable` method for commands
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 3e4d657..0e672e6 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -47,6 +47,7 @@
#include "cmMSVC60LinkLineComputer.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
+#include "cmOutputConverter.h"
#include "cmPolicies.h"
#include "cmRange.h"
#include "cmSourceFile.h"
@@ -73,6 +74,23 @@ const std::string kCMAKE_PLATFORM_INFO_INITIALIZED =
class cmInstalledFile;
+namespace detail {
+std::string GeneratedMakeCommand::QuotedPrintable() const
+{
+ std::string output;
+ const char* sep = "";
+ int flags = 0;
+#if !defined(_WIN32)
+ flags |= cmOutputConverter::Shell_Flag_IsUnix;
+#endif
+ for (auto const& arg : this->PrimaryCommand) {
+ output += cmStrCat(sep, cmOutputConverter::EscapeForShell(arg, flags));
+ sep = " ";
+ }
+ return output;
+}
+}
+
bool cmTarget::StrictTargetComparison::operator()(cmTarget const* t1,
cmTarget const* t2) const
{