diff options
author | Brad King <brad.king@kitware.com> | 2020-04-10 16:08:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-04-15 12:34:48 (GMT) |
commit | 031bfaa865956c101aff74d35573381ebe71f0a1 (patch) | |
tree | 64bdc894e8fca69c1f1439765362fc2dda55c960 /Source/cmGlobalUnixMakefileGenerator3.cxx | |
parent | ca343dad0782733e5e39e7f1427d613e1cad5cf9 (diff) | |
download | CMake-031bfaa865956c101aff74d35573381ebe71f0a1.zip CMake-031bfaa865956c101aff74d35573381ebe71f0a1.tar.gz CMake-031bfaa865956c101aff74d35573381ebe71f0a1.tar.bz2 |
Makefiles: Factor out makefile target path escaping and quoting
Code paths that write makefile target paths use a combination of
`cmSystemTools::ConvertToOutputPath` and `cmMakeSafe`. Some were
missing the latter. Wrap these two steps up into a dedicated
`ConvertToMakefilePath` method provided on both the local and global
generators.
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 3ace290..8a41d49 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -486,6 +486,25 @@ void cmGlobalUnixMakefileGenerator3::WriteDirectoryRules2( } } +std::string cmGlobalUnixMakefileGenerator3::ConvertToMakefilePath( + std::string const& path) const +{ + std::string const& out = cmSystemTools::ConvertToOutputPath(path); + std::string result; + result.reserve(out.size()); + for (char c : out) { + switch (c) { + case '=': + result.append("$(EQUALS)"); + break; + default: + result.push_back(c); + break; + } + } + return result; +} + std::vector<cmGlobalGenerator::GeneratedMakeCommand> cmGlobalUnixMakefileGenerator3::GenerateBuildCommand( const std::string& makeProgram, const std::string& /*projectName*/, |