diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-08-19 20:27:34 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-08-22 12:24:43 -0700 |
commit | 5e93393cd912f08dd6b561b78f50a83fef430097 (patch) | |
tree | e3b84887ee1e371b54b39fed82c23283c3d9a408 /test cases | |
parent | bb5f2ca3da821d7a8e865cd55a8d5d638e0aab22 (diff) | |
download | meson-5e93393cd912f08dd6b561b78f50a83fef430097.zip meson-5e93393cd912f08dd6b561b78f50a83fef430097.tar.gz meson-5e93393cd912f08dd6b561b78f50a83fef430097.tar.bz2 |
Test that system shlibs with undefined symbols can be found
Diffstat (limited to 'test cases')
3 files changed, 32 insertions, 4 deletions
diff --git a/test cases/unit/39 external, internal library rpath/built library/meson.build b/test cases/unit/39 external, internal library rpath/built library/meson.build index 2b422f4..f633996 100644 --- a/test cases/unit/39 external, internal library rpath/built library/meson.build +++ b/test cases/unit/39 external, internal library rpath/built library/meson.build @@ -1,12 +1,21 @@ project('built library', 'c') cc = meson.get_compiler('c') + +if host_machine.system() != 'cygwin' + # bar_in_system has undefined symbols, but still must be found + bar_system_dep = cc.find_library('bar_in_system') +endif + foo_system_dep = cc.find_library('foo_in_system') + faa_pkg_dep = dependency('faa_pkg') l = shared_library('bar_built', 'bar.c', install: true, dependencies : [foo_system_dep, faa_pkg_dep]) -e = executable('prog', 'prog.c', link_with: l, install: true) -test('testprog', e) +if host_machine.system() == 'darwin' + e = executable('prog', 'prog.c', link_with: l, install: true) + test('testprog', e) +endif diff --git a/test cases/unit/39 external, internal library rpath/external library/bar.c b/test cases/unit/39 external, internal library rpath/external library/bar.c new file mode 100644 index 0000000..c6f42d6 --- /dev/null +++ b/test cases/unit/39 external, internal library rpath/external library/bar.c @@ -0,0 +1,6 @@ +int some_undefined_func (void); + +int bar_system_value (void) +{ + return some_undefined_func (); +} diff --git a/test cases/unit/39 external, internal library rpath/external library/meson.build b/test cases/unit/39 external, internal library rpath/external library/meson.build index 6dcc97e..3c311f5 100644 --- a/test cases/unit/39 external, internal library rpath/external library/meson.build +++ b/test cases/unit/39 external, internal library rpath/external library/meson.build @@ -1,9 +1,22 @@ -project('system library', 'c') +project('system library', 'c', default_options : ['b_lundef=false']) shared_library('foo_in_system', 'foo.c', install : true) l = shared_library('faa_pkg', 'faa.c', install: true) +if host_machine.system() == 'darwin' + frameworks = ['-framework', 'CoreFoundation', '-framework', 'CoreMedia'] + allow_undef_args = ['-Wl,-undefined,dynamic_lookup'] +else + frameworks = [] + allow_undef_args = [] +endif + pkg = import('pkgconfig') pkg.generate(name: 'faa_pkg', - libraries: [l, '-framework', 'CoreFoundation', '-framework', 'CoreMedia'], + libraries: [l] + frameworks, description: 'FAA, a pkg-config test library') + +# cygwin DLLs can't have undefined symbols +if host_machine.system() != 'cygwin' + shared_library('bar_in_system', 'bar.c', install : true, link_args : allow_undef_args) +endif |