cmBinUtilsWindowsPELinker: Track cased and lower names more clearly

This commit is contained in:
Brad King
2026-08-27 16:58:03 -04:00
parent f7ce592c98
commit 6ed37c9ed0
2 changed files with 11 additions and 8 deletions
+10 -8
View File
@@ -101,28 +101,30 @@ bool cmBinUtilsWindowsPELinker::ScanDependencies(std::string const& file,
if (this->Archive->IsPreExcluded(lib.LowerName)) {
continue;
}
std::string path;
Dependency path;
bool resolved = false;
if (!this->ResolveDependency(lib.LowerName, origin, path, resolved)) {
if (!this->ResolveDependency(lib.LowerName, origin, path.LowerName,
resolved)) {
return false;
}
if (resolved) {
if (this->Archive->IsPostExcluded(path)) {
if (this->Archive->IsPostExcluded(path.LowerName)) {
continue;
}
#ifdef _WIN32
path = ReplaceWithActualNameCasing(path);
path.CasedName = ReplaceWithActualNameCasing(path.LowerName);
#else
path = [&lib](std::string libPath) -> std::string {
path.CasedName = [&lib](std::string libPath) -> std::string {
libPath.replace(libPath.end() - lib.CasedName.size(), libPath.end(),
lib.CasedName);
return libPath;
}(path);
}(path.LowerName);
#endif
bool unique;
this->Archive->AddResolvedPath(lib.CasedName, path, unique);
this->Archive->AddResolvedPath(lib.CasedName, path.CasedName, unique);
if (unique &&
!this->ScanDependencies(path, cm::TargetType::SHARED_LIBRARY)) {
!this->ScanDependencies(path.CasedName,
cm::TargetType::SHARED_LIBRARY)) {
return false;
}
} else {
+1
View File
@@ -25,6 +25,7 @@ private:
struct Dependency
{
Dependency() = default;
Dependency(std::string casedName);
std::string CasedName;
std::string LowerName;