Recognize OpenBSD versioned .so names (#12954)
OpenBSD shared library names end in a ".#.#" version number suffix. Teach cmComputeLinkInformation to tolerate the extra suffix after the normal library name suffixes when parsing library names.
This commit is contained in:
parent
16b1a6e4e0
commit
afc75bb7f5
|
@ -248,6 +248,10 @@ cmComputeLinkInformation
|
|||
this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator();
|
||||
this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance();
|
||||
|
||||
// Check whether to recognize OpenBSD-style library versioned names.
|
||||
this->OpenBSD = this->Makefile->GetCMakeInstance()
|
||||
->GetPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING");
|
||||
|
||||
// The configuration being linked.
|
||||
this->Config = config;
|
||||
|
||||
|
@ -973,7 +977,15 @@ cmComputeLinkInformation
|
|||
}
|
||||
|
||||
// Finish the list.
|
||||
libext += ")$";
|
||||
libext += ")";
|
||||
|
||||
// Add an optional OpenBSD version component.
|
||||
if(this->OpenBSD)
|
||||
{
|
||||
libext += "(\\.[0-9]+\\.[0-9]+)?";
|
||||
}
|
||||
|
||||
libext += "$";
|
||||
return libext;
|
||||
}
|
||||
|
||||
|
|
|
@ -128,6 +128,7 @@ private:
|
|||
cmsys::RegularExpression ExtractSharedLibraryName;
|
||||
cmsys::RegularExpression ExtractAnyLibraryName;
|
||||
std::string SharedRegexString;
|
||||
bool OpenBSD;
|
||||
void AddLinkPrefix(const char* p);
|
||||
void AddLinkExtension(const char* e, LinkType type);
|
||||
std::string CreateExtensionRegex(std::vector<std::string> const& exts);
|
||||
|
|
Loading…
Reference in New Issue