diff options
-rw-r--r-- | ninjabackend.py | 4 | ||||
-rw-r--r-- | test cases/linuxlike/4 extdep static lib/lib.c | 8 | ||||
-rw-r--r-- | test cases/linuxlike/4 extdep static lib/meson.build | 10 | ||||
-rw-r--r-- | test cases/linuxlike/4 extdep static lib/prog.c | 5 |
4 files changed, 27 insertions, 0 deletions
diff --git a/ninjabackend.py b/ninjabackend.py index fecdbf3..08e43b4 100644 --- a/ninjabackend.py +++ b/ninjabackend.py @@ -1252,6 +1252,10 @@ rule FORTRAN_DEP_HACK if not(isinstance(target, build.StaticLibrary)): for dep in target.get_external_deps(): commands += dep.get_link_args() + for d in target.get_dependencies(): + if isinstance(d, build.StaticLibrary): + for dep in d.get_external_deps(): + commands += dep.get_link_args() commands += linker.build_rpath_args(self.environment.get_build_dir(),\ target.get_rpaths(), target.install_rpath) if self.environment.coredata.coverage: diff --git a/test cases/linuxlike/4 extdep static lib/lib.c b/test cases/linuxlike/4 extdep static lib/lib.c new file mode 100644 index 0000000..2f3b3c9 --- /dev/null +++ b/test cases/linuxlike/4 extdep static lib/lib.c @@ -0,0 +1,8 @@ +#include<zlib.h> + +int statlibfunc() { + void * something = deflate; + if(something != 0) + return 0; + return 1; +} diff --git a/test cases/linuxlike/4 extdep static lib/meson.build b/test cases/linuxlike/4 extdep static lib/meson.build new file mode 100644 index 0000000..1a73e49 --- /dev/null +++ b/test cases/linuxlike/4 extdep static lib/meson.build @@ -0,0 +1,10 @@ +project('external dependency with static', 'c') + +# Zlib is probably on all dev machines. + +dep = dependency('zlib') +statlib = static_library('statlib', 'lib.c', dependencies : dep) +exe = executable('prog', 'prog.c', link_with : statlib) + + +test('zlibtest', exe) diff --git a/test cases/linuxlike/4 extdep static lib/prog.c b/test cases/linuxlike/4 extdep static lib/prog.c new file mode 100644 index 0000000..843c628 --- /dev/null +++ b/test cases/linuxlike/4 extdep static lib/prog.c @@ -0,0 +1,5 @@ +int statlibfunc(); + +int main(int argc, char **argv) { + return statlibfunc(); +} |