diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-09-08 00:12:38 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-09-13 16:13:44 -0700 |
commit | 0faaf9720f65d53dc4f9e28f786cb8dee0b7046d (patch) | |
tree | 319c0d1aa65db737c368e43aa59c9d7b500b4ed3 /test cases/linuxlike | |
parent | 692fade34e05e4f64b40e9f2c278719294079a63 (diff) | |
download | meson-0faaf9720f65d53dc4f9e28f786cb8dee0b7046d.zip meson-0faaf9720f65d53dc4f9e28f786cb8dee0b7046d.tar.gz meson-0faaf9720f65d53dc4f9e28f786cb8dee0b7046d.tar.bz2 |
Fix "test cases/linuxlike/14 static dynamic linkage" on Solaris
Solaris doesn't ship static libraries, so the test can't rely on libz.a
existing on Solaris.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'test cases/linuxlike')
-rw-r--r-- | test cases/linuxlike/14 static dynamic linkage/meson.build | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/test cases/linuxlike/14 static dynamic linkage/meson.build b/test cases/linuxlike/14 static dynamic linkage/meson.build index a529f33..fb0e353 100644 --- a/test cases/linuxlike/14 static dynamic linkage/meson.build +++ b/test cases/linuxlike/14 static dynamic linkage/meson.build @@ -1,22 +1,36 @@ project('static dynamic', 'c') +# Solaris does not ship static libraries +if host_machine.system() == 'sunos' + has_static = false +else + has_static = true +endif cc = meson.get_compiler('c') z_default = cc.find_library('z') -z_static = cc.find_library('z', static: true) +if has_static + z_static = cc.find_library('z', static: true) +endif z_dynamic = cc.find_library('z', static: false) exe_default = executable('main_default', 'main.c', dependencies: [z_default]) -exe_static = executable('main_static', 'main.c', dependencies: [z_static]) +if has_static + exe_static = executable('main_static', 'main.c', dependencies: [z_static]) +endif exe_dynamic = executable('main_dynamic', 'main.c', dependencies: [z_dynamic]) test('test default', exe_default) -test('test static', exe_static) +if has_static + test('test static', exe_static) +endif test('test dynamic', exe_dynamic) -test('verify static linking', find_program('verify_static.py'), - args: ['--platform=' + host_machine.system(), exe_static.full_path()]) +if has_static + test('verify static linking', find_program('verify_static.py'), + args: ['--platform=' + host_machine.system(), exe_static.full_path()]) +endif test('verify dynamic linking', find_program('verify_static.py'), args: ['--platform=' + host_machine.system(), exe_dynamic.full_path()], should_fail: true) |