diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-03-18 13:48:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-18 13:48:41 +0100 |
commit | d3dabfc8eef39d30f367bc824bd3c631b74d4de8 (patch) | |
tree | 7c53fef0a90adc2d015fab93f2ec9cfe0b86b934 /fastos | |
parent | 03c439110445b75dd124e55461a6d571f36c9d29 (diff) | |
parent | f20957c4d0d6eaf574d711bab19abf793ef7c084 (diff) |
Merge pull request #8817 from vespa-engine/toregge/handle-shared-library-names-on-darwin
Handle shared library names on darwin.
Diffstat (limited to 'fastos')
-rw-r--r-- | fastos/src/vespa/fastos/unix_dynamiclibrary.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/fastos/src/vespa/fastos/unix_dynamiclibrary.cpp b/fastos/src/vespa/fastos/unix_dynamiclibrary.cpp index f3d3aa35511..16533445757 100644 --- a/fastos/src/vespa/fastos/unix_dynamiclibrary.cpp +++ b/fastos/src/vespa/fastos/unix_dynamiclibrary.cpp @@ -6,13 +6,24 @@ namespace { const std::string FASTOS_DYNLIB_PREFIX("lib"); +#ifdef __APPLE__ +const std::string FASTOS_DYNLIB_SUFFIX(".dylib"); +#else const std::string FASTOS_DYNLIB_SUFFIX(".so"); const std::string FASTOS_DYNLIB_SUFPREFIX(".so."); +#endif bool hasValidSuffix(const std::string & s) { - return (s.rfind(FASTOS_DYNLIB_SUFFIX) == (s.size() - FASTOS_DYNLIB_SUFFIX.size())) - || (s.rfind(FASTOS_DYNLIB_SUFPREFIX) != std::string::npos); + if (s.rfind(FASTOS_DYNLIB_SUFFIX) == (s.size() - FASTOS_DYNLIB_SUFFIX.size())) { + return true; + } +#ifndef __APPLE__ + if (s.rfind(FASTOS_DYNLIB_SUFPREFIX) != std::string::npos) { + return true; + } +#endif + return false; } } |