From 3a846ff409d93faf8b3c912ed3cdce6c49628f1d Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Mon, 30 Oct 2023 11:21:43 -0500 Subject: tests: Also test implicit rpaths from dependencies Meson will implicit rpaths when *.so/*.dll/etc. files are injected onto the link line from pkg-config and (now) cmake dependencies. Extend the "prebuilt shared" tests to test that these are added. --- test cases/unit/17 prebuilt shared/meson.build | 16 ++++++++++------ test cases/unit/17 prebuilt shared/meson_options.txt | 3 +++ 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'test cases') diff --git a/test cases/unit/17 prebuilt shared/meson.build b/test cases/unit/17 prebuilt shared/meson.build index 7badcb746..5107fca4f 100644 --- a/test cases/unit/17 prebuilt shared/meson.build +++ b/test cases/unit/17 prebuilt shared/meson.build @@ -1,13 +1,17 @@ project('prebuilt shared library', 'c') -search_dir = get_option('search_dir') -if search_dir == 'auto' - search_dir = meson.current_source_dir() +if get_option('method') == 'find_library' + search_dir = get_option('search_dir') + if search_dir == 'auto' + search_dir = meson.current_source_dir() + endif + + cc = meson.get_compiler('c') + shlib = cc.find_library('alexandria', dirs : search_dir) +else + shlib = dependency('alexandria', method: get_option('method')) endif -cc = meson.get_compiler('c') -shlib = cc.find_library('alexandria', dirs : search_dir) - exe = executable('patron', 'patron.c', dependencies : shlib) test('visitation', exe) diff --git a/test cases/unit/17 prebuilt shared/meson_options.txt b/test cases/unit/17 prebuilt shared/meson_options.txt index 7876a6fd4..d9d0d67c9 100644 --- a/test cases/unit/17 prebuilt shared/meson_options.txt +++ b/test cases/unit/17 prebuilt shared/meson_options.txt @@ -1 +1,4 @@ +option('method', type : 'combo', + choices : ['find_library', 'pkg-config', 'cmake'], + value : 'find_library') option('search_dir', type : 'string', value : 'auto') -- cgit v1.2.3