summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorJohnny Jazeix <jazeix@gmail.com>2019-12-26 16:39:36 (GMT)
committerJohnny Jazeix <jazeix@gmail.com>2019-12-26 16:39:36 (GMT)
commita024d614ca60080e71cdca6c56fed44f9a9e64a3 (patch)
treed3b59c97824e5f6c632b1501407ba1f79968909a /Source
parent419fd17aa99576cf75ea083eef2e93b80688c37b (diff)
downloadCMake-a024d614ca60080e71cdca6c56fed44f9a9e64a3.zip
CMake-a024d614ca60080e71cdca6c56fed44f9a9e64a3.tar.gz
CMake-a024d614ca60080e71cdca6c56fed44f9a9e64a3.tar.bz2
cmCoreTryCompile::CleanupFiles now removes symlinks instead of their contents.
Fixes: #17522
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCoreTryCompile.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 4715cfa..da04396 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -1045,7 +1045,9 @@ void cmCoreTryCompile::CleanupFiles(std::string const& binDir)
if (deletedFiles.insert(fileName).second) {
std::string const fullPath =
std::string(binDir).append("/").append(fileName);
- if (cmSystemTools::FileIsDirectory(fullPath)) {
+ if (cmSystemTools::FileIsSymlink(fullPath)) {
+ cmSystemTools::RemoveFile(fullPath);
+ } else if (cmSystemTools::FileIsDirectory(fullPath)) {
this->CleanupFiles(fullPath);
cmSystemTools::RemoveADirectory(fullPath);
} else {