diff options
author | gsobala <gsobala@gmail.com> | 2018-10-13 15:00:06 +0100 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-10-13 07:00:06 -0700 |
commit | 0ea626b89d66089705177f68b3f15d2750dbe0bc (patch) | |
tree | b774889db2aa2174682aa69caf706188e7eae425 | |
parent | b9e405c634bc7c00b604cc08934512a134337317 (diff) | |
download | meson-0ea626b89d66089705177f68b3f15d2750dbe0bc.zip meson-0ea626b89d66089705177f68b3f15d2750dbe0bc.tar.gz meson-0ea626b89d66089705177f68b3f15d2750dbe0bc.tar.bz2 |
Added .so to list possible darwin dynamic library suffixes (#4364)
Occasionally Darwin libraries can be .so rather than .dylib e.g. tensorflow_cc.so
tensorflow_cc is a c++ API for Tensorflow (https://github.com/FloopCZ/tensorflow_cc)
which was primarily written for Linux but is also compilable on Darwin. Possibly
through laziness, possibly just to have consistent filenames, the developers did not
opt to change the suffix from the Linux default when this is compiled on Darwin.
Also, the Darwin linker will find libraries with a .so suffix if they are
in its path. find_library() needs to match the linker behaviour.
-rw-r--r-- | mesonbuild/compilers/c.py | 2 | ||||
-rwxr-xr-x | run_unittests.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index b523d40..8b46804 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -896,7 +896,7 @@ class CCompiler(Compiler): prefixes = ['lib', ''] # Library suffixes and prefixes if for_darwin(env.is_cross_build(), env): - shlibext = ['dylib'] + shlibext = ['dylib', 'so'] elif for_windows(env.is_cross_build(), env): # FIXME: .lib files can be import or static so we should read the # file, figure out which one it is, and reject the wrong kind. diff --git a/run_unittests.py b/run_unittests.py index 9b7e45a..58b273d 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -584,7 +584,7 @@ class InternalTests(unittest.TestCase): 'static': unix_static}, 'linux': {'shared': ('lib{}.so', '{}.so'), 'static': unix_static}, - 'darwin': {'shared': ('lib{}.dylib', '{}.dylib'), + 'darwin': {'shared': ('lib{}.dylib', 'lib{}.so', '{}.dylib', '{}.so'), 'static': unix_static}, 'cygwin': {'shared': ('cyg{}.dll', 'cyg{}.dll.a', 'lib{}.dll', 'lib{}.dll.a', '{}.dll', '{}.dll.a'), |