mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-04 04:03:22 +03:00
Sanitize paths from LINK_DIRECTORIES directory property
Normally they are sanitized by the `link_directories` command before populating the property, but projects may set the property directly.
This commit is contained in:
1 parent
561238bb6f
commit
0ad329f7c0
1 file changed
+4
-6
@@ -1836,12 +1836,10 @@ void cmMakefile::AddGlobalLinkInformation(cmTarget& target)
|
||||
std::vector<std::string> linkDirs;
|
||||
cmSystemTools::ExpandListArgument(linkDirsProp, linkDirs);
|
||||
|
||||
for (std::string const& linkDir : linkDirs) {
|
||||
std::string newdir = linkDir;
|
||||
// remove trailing slashes
|
||||
if (*linkDir.rbegin() == '/') {
|
||||
newdir = linkDir.substr(0, linkDir.size() - 1);
|
||||
}
|
||||
for (std::string& linkDir : linkDirs) {
|
||||
// Sanitize the path the same way the link_directories command does
|
||||
// in case projects set the LINK_DIRECTORIES property directly.
|
||||
cmSystemTools::ConvertToUnixSlashes(linkDir);
|
||||
target.AddLinkDirectory(linkDir);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user