summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-12-20 16:35:09 (GMT)
committerBrad King <brad.king@kitware.com>2017-12-20 16:35:09 (GMT)
commit099a4ea50c4fbe5fe13cf6fa4abcf970c49e787c (patch)
tree0a2d7a98bf347880dba8137a6e596fbddfa9b989
parent4d6c27360636ecaa9f815306fecb3b5fbcce68bc (diff)
downloadCMake-099a4ea50c4fbe5fe13cf6fa4abcf970c49e787c.zip
CMake-099a4ea50c4fbe5fe13cf6fa4abcf970c49e787c.tar.gz
CMake-099a4ea50c4fbe5fe13cf6fa4abcf970c49e787c.tar.bz2
cmcmd: Fix cmake_symlink_library for inconsistent slashes
With the Ninja generator we may invoke `cmake_symlink_library` with different slash conventions (`/` versus `\`) for different arguments. Fix comparison of the paths/names given to tolerate this. Fixes: #17579
-rw-r--r--Source/cmcmd.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index b78fbe6..f660f43 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -1237,9 +1237,12 @@ int cmcmd::HashSumFile(std::vector<std::string>& args, cmCryptoHash::Algo algo)
int cmcmd::SymlinkLibrary(std::vector<std::string>& args)
{
int result = 0;
- std::string const& realName = args[2];
- std::string const& soName = args[3];
- std::string const& name = args[4];
+ std::string realName = args[2];
+ std::string soName = args[3];
+ std::string name = args[4];
+ cmSystemTools::ConvertToUnixSlashes(realName);
+ cmSystemTools::ConvertToUnixSlashes(soName);
+ cmSystemTools::ConvertToUnixSlashes(name);
if (soName != realName) {
if (!cmcmd::SymlinkInternal(realName, soName)) {
cmSystemTools::ReportLastSystemError("cmake_symlink_library");