BUG: Fix link flags on cygwin shared libraries. This requires that the shared library prefix be supported in the link library regex.

This commit is contained in:
Brad King 2006-10-05 15:08:20 -04:00
parent 7e92f0b4e4
commit 7ad07e0811
6 changed files with 12 additions and 9 deletions

View File

@ -1712,8 +1712,10 @@ void cmLocalGenerator
orderLibs.SetLinkTypeInformation(cmOrderLinkDirectories::LinkShared,
static_link_type_flag,
shared_link_type_flag);
orderLibs.SetLinkPrefix(
orderLibs.AddLinkPrefix(
this->Makefile->GetDefinition("CMAKE_STATIC_LIBRARY_PREFIX"));
orderLibs.AddLinkPrefix(
this->Makefile->GetDefinition("CMAKE_SHARED_LIBRARY_PREFIX"));
orderLibs.AddLinkExtension(
this->Makefile->GetDefinition("CMAKE_STATIC_LIBRARY_SUFFIX"),
cmOrderLinkDirectories::LinkStatic);

View File

@ -189,9 +189,10 @@ void cmOrderLinkDirectories::CreateRegularExpressions()
// be the library name. Match index 3 will be the library
// extension.
reg = "^(";
if(!this->LinkPrefix.empty())
for(std::set<cmStdString>::iterator p = this->LinkPrefixes.begin();
p != this->LinkPrefixes.end(); ++p)
{
reg += this->LinkPrefix;
reg += *p;
reg += "|";
}
reg += ")";

View File

@ -83,11 +83,11 @@ public:
}
}
// should be set from CMAKE_STATIC_LIBRARY_PREFIX
void SetLinkPrefix(const char* s)
void AddLinkPrefix(const char* s)
{
if(s)
{
this->LinkPrefix = s;
this->LinkPrefixes.insert(s);
}
}
// Return any warnings if the exist
@ -164,7 +164,7 @@ private:
std::vector<cmStdString> SharedLinkExtensions;
std::vector<cmStdString> LinkExtensions;
// the names of link prefixes
cmStdString LinkPrefix;
std::set<cmStdString> LinkPrefixes;
// set of directories that can not be put in the correct order
std::set<cmStdString> ImpossibleDirectories;
// Name of target

View File

@ -108,7 +108,7 @@ bool TestLibraryOrder(bool shouldFail)
orderLibs.DebugOn();
orderLibs.AddLinkExtension(".so");
orderLibs.AddLinkExtension(".a");
orderLibs.SetLinkPrefix("lib");
orderLibs.AddLinkPrefix("lib");
cmTargetManifest manifest;
orderLibs.SetLinkInformation("test", linkLibraries, linkDirectories,
manifest, "");

View File

@ -108,7 +108,7 @@ bool TestLibraryOrder(bool shouldFail)
orderLibs.DebugOn();
orderLibs.AddLinkExtension(".so");
orderLibs.AddLinkExtension(".a");
orderLibs.SetLinkPrefix("lib");
orderLibs.AddLinkPrefix("lib");
cmTargetManifest manifest;
orderLibs.SetLinkInformation("test", linkLibraries, linkDirectories,
manifest, "");

View File

@ -108,7 +108,7 @@ bool TestLibraryOrder(bool shouldFail)
orderLibs.DebugOn();
orderLibs.AddLinkExtension(".so");
orderLibs.AddLinkExtension(".a");
orderLibs.SetLinkPrefix("lib");
orderLibs.AddLinkPrefix("lib");
cmTargetManifest manifest;
orderLibs.SetLinkInformation("test", linkLibraries, linkDirectories,
manifest, "");