aboutsummaryrefslogtreecommitdiff
path: root/test cases/linuxlike
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2014-09-03 22:13:14 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2014-09-03 22:13:14 +0300
commit3ed22fcc56877ca974e31b7fd80343b126f866aa (patch)
tree3e8663e88105715a32b94bd4abf45c4cd62ceab1 /test cases/linuxlike
parent1c0a735e00e12140817432f5b1218f388f59b287 (diff)
downloadmeson-3ed22fcc56877ca974e31b7fd80343b126f866aa.zip
meson-3ed22fcc56877ca974e31b7fd80343b126f866aa.tar.gz
meson-3ed22fcc56877ca974e31b7fd80343b126f866aa.tar.bz2
Use external libs of static libraries when the static library is linked to a final target.
Diffstat (limited to 'test cases/linuxlike')
-rw-r--r--test cases/linuxlike/4 extdep static lib/lib.c8
-rw-r--r--test cases/linuxlike/4 extdep static lib/meson.build10
-rw-r--r--test cases/linuxlike/4 extdep static lib/prog.c5
3 files changed, 23 insertions, 0 deletions
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();
+}