diff options
Diffstat (limited to 'test cases')
| -rw-r--r-- | test cases/unit/17 prebuilt shared/meson.build | 16 | ||||
| -rw-r--r-- | test cases/unit/17 prebuilt shared/meson_options.txt | 3 |
2 files changed, 13 insertions, 6 deletions
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') |
