Use external libs of static libraries when the static library is linked to a final target.

pull/15/head
Jussi Pakkanen 11 years ago
parent 1c0a735e00
commit 3ed22fcc56
  1. 4
      ninjabackend.py
  2. 8
      test cases/linuxlike/4 extdep static lib/lib.c
  3. 10
      test cases/linuxlike/4 extdep static lib/meson.build
  4. 5
      test cases/linuxlike/4 extdep static lib/prog.c

@ -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:

@ -0,0 +1,8 @@
#include<zlib.h>
int statlibfunc() {
void * something = deflate;
if(something != 0)
return 0;
return 1;
}

@ -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)

@ -0,0 +1,5 @@
int statlibfunc();
int main(int argc, char **argv) {
return statlibfunc();
}
Loading…
Cancel
Save