summaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorCharles Brunet <charles.brunet@optelgroup.com>2025-01-08 13:38:23 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2025-01-19 20:51:30 +0200
commit843895b860dbfdbc4d8669006509adadeb173cbc (patch)
treee5cebcc4faf6e26c62d7e709d1c3f6bfe5062648 /test cases
parent887367656f2cbe76df7d8b19f380904be8aa49e2 (diff)
downloadmeson-843895b860dbfdbc4d8669006509adadeb173cbc.tar.gz
Fix broken both_libraries transitive dependencies
#13837 broke both_lib transitive deps, because the `as_static` and `as_shared` functions return libraries that still contain references to the other lib type.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/273 both libraries/meson.build29
1 files changed, 29 insertions, 0 deletions
diff --git a/test cases/common/273 both libraries/meson.build b/test cases/common/273 both libraries/meson.build
index 00da1c8e6..789f4205e 100644
--- a/test cases/common/273 both libraries/meson.build
+++ b/test cases/common/273 both libraries/meson.build
@@ -111,3 +111,32 @@ if get_option('default_library') == 'both' and get_option('default_both_librarie
)
test('test shared', main_shared)
endif
+
+# Test case for https://github.com/mesonbuild/meson/pull/14098
+if get_option('default_library') == 'shared'
+
+ if get_option('use_dep')
+ lib_deps = [with_bl_dep.as_static(recursive: true)]
+ lib_links = []
+ else
+ lib_deps = []
+ lib_links = [with_bl.get_static_lib()]
+ endif
+
+ lib_with_static_dep = library(
+ 'lib_with_static_dep',
+ files('src/library.c'),
+ c_shared_args: ['-DEXPORT'],
+ link_with: lib_links,
+ dependencies: lib_deps,
+ )
+
+ main_with_static_dep = executable(
+ 'main_with_static_dep',
+ files('src/main.c'),
+ c_args: [f'-DEXPECTED=1'],
+ link_with: lib_with_static_dep,
+ )
+ test('test static dep', main_with_static_dep)
+
+endif