diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 890e905c0..84b490264 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -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); diff --git a/Source/cmOrderLinkDirectories.cxx b/Source/cmOrderLinkDirectories.cxx index ab3fe9caa..fe00ec26b 100644 --- a/Source/cmOrderLinkDirectories.cxx +++ b/Source/cmOrderLinkDirectories.cxx @@ -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::iterator p = this->LinkPrefixes.begin(); + p != this->LinkPrefixes.end(); ++p) { - reg += this->LinkPrefix; + reg += *p; reg += "|"; } reg += ")"; diff --git a/Source/cmOrderLinkDirectories.h b/Source/cmOrderLinkDirectories.h index 0da6e8530..a3bc75a6d 100644 --- a/Source/cmOrderLinkDirectories.h +++ b/Source/cmOrderLinkDirectories.h @@ -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 SharedLinkExtensions; std::vector LinkExtensions; // the names of link prefixes - cmStdString LinkPrefix; + std::set LinkPrefixes; // set of directories that can not be put in the correct order std::set ImpossibleDirectories; // Name of target diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index 759cfd937..273e8a267 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -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, ""); diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index 759cfd937..273e8a267 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/Executable/complex.cxx @@ -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, ""); diff --git a/Tests/ComplexRelativePaths/Executable/complex.cxx b/Tests/ComplexRelativePaths/Executable/complex.cxx index 759cfd937..273e8a267 100644 --- a/Tests/ComplexRelativePaths/Executable/complex.cxx +++ b/Tests/ComplexRelativePaths/Executable/complex.cxx @@ -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, "");