Commit d2b10815 authored by Brad King's avatar Brad King 💬
Browse files

BUG: Recognize .so shared libraries on HP-UX

HP-UX uses both .sl and .so as extensions for shared libraries.  This
teaches CMake to recognize .so shared libraries so they are treated
properly during link dependency analysis.
parent 1d3320f1
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".sl") # .so
SET(CMAKE_DL_LIBS "dld")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".sl" ".so" ".a")
SET(CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES ".so")
# The HP linker needs to find transitive shared library dependencies
# in the -L path. Therefore the runtime path must be added to the
......
......@@ -814,6 +814,17 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
this->AddLinkExtension(i->c_str(), LinkUnknown);
}
}
if(const char* sharedSuffixes =
mf->GetDefinition("CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES"))
{
std::vector<std::string> sharedSuffixVec;
cmSystemTools::ExpandListArgument(sharedSuffixes, sharedSuffixVec);
for(std::vector<std::string>::iterator i = sharedSuffixVec.begin();
i != sharedSuffixVec.end(); ++i)
{
this->AddLinkExtension(i->c_str(), LinkShared);
}
}
// Compute a regex to match link extensions.
std::string libext = this->CreateExtensionRegex(this->LinkExtensions);
......
......@@ -377,6 +377,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"The suffix to use for the end of a static library, .lib on Windows.",
false,
"Variables that Provide Information");
cm->DefineProperty
("CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES", cmProperty::VARIABLE,
"Additional suffixes for shared libraries.",
"Extensions for shared libraries other than that specified by "
"CMAKE_SHARED_LIBRARY_SUFFIX, if any. "
"CMake uses this to recognize external shared library files during "
"analysis of libraries linked by a target.",
false,
"Variables that Provide Information");
// Variables defined by cmake, that change the behavior
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment