diff options
author | Brad King <brad.king@kitware.com> | 2008-02-21 18:58:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-02-21 18:58:41 (GMT) |
commit | 782e9f7ffe722fc7dac1353cd95a31e7140e5c6f (patch) | |
tree | b4acc56525e8c006fd2da48e28d5f28c41a8e3e0 /Source/cmOrderDirectories.cxx | |
parent | fd37a6ec3d31e65eed2dfa88246e86b8d0ab66ab (diff) | |
download | CMake-782e9f7ffe722fc7dac1353cd95a31e7140e5c6f.zip CMake-782e9f7ffe722fc7dac1353cd95a31e7140e5c6f.tar.gz CMake-782e9f7ffe722fc7dac1353cd95a31e7140e5c6f.tar.bz2 |
ENH: Improve linking to third-party shared libraries on soname platforms
- Reduce false positives in cases of unknown soname
- Make library extension regular expressions match only at end of string
- When linking to libraries in implicit dirs convert to the -l option
only if the file name is one that can be found by the linker
(ex. /usr/lib/libfoo.so.1 should be linked by full path)
- Add cmSystemTools::GuessLibrarySOName to guess the soname of a
library based on presence of a symlink
- In cmComputeLinkInformation try to guess an soname before assuming
that a third-party library is built without an soname
- In cmOrderDirectories guess the soname of shared libraries in cases
it is otherwise unknown
Diffstat (limited to 'Source/cmOrderDirectories.cxx')
-rw-r--r-- | Source/cmOrderDirectories.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 7bc5dd6..a0ff9c1 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -119,6 +119,15 @@ public: const char* soname): cmOrderDirectoriesConstraint(od, file), SOName(soname? soname : "") { + if(this->SOName.empty()) + { + // Try to guess the soname. + std::string soguess; + if(cmSystemTools::GuessLibrarySOName(file, soguess)) + { + this->SOName = soguess; + } + } } virtual void Report(std::ostream& e) @@ -164,7 +173,6 @@ bool cmOrderDirectoriesConstraintSOName::FindConflict(std::string const& dir) // Get the set of files that might conflict. Since we do not // know the soname just look at all files that start with the // file name. Usually the soname starts with the library name. - // TODO: Check if the library is a symlink and guess the soname. std::string base = this->FileName; std::set<cmStdString>::const_iterator first = files.lower_bound(base); ++base[base.size()-1]; |