aboutsummaryrefslogtreecommitdiff
path: root/test cases/unit
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-07-08 15:56:08 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2023-07-10 23:12:24 +0300
commitcd63853ad2928023ea045fb331866d547e9f49fc (patch)
tree074be964c4efa8e6903d71edeb0db6c8f728241e /test cases/unit
parentad13d9f4a3e90fbe05544c28437090f155d8994b (diff)
downloadmeson-cd63853ad2928023ea045fb331866d547e9f49fc.zip
meson-cd63853ad2928023ea045fb331866d547e9f49fc.tar.gz
meson-cd63853ad2928023ea045fb331866d547e9f49fc.tar.bz2
build: Fix linking multiple libraries and some are promoted
When a link() is promoted to link_whole() we still have to handle the rest of the list. Fixes: #11956
Diffstat (limited to 'test cases/unit')
-rw-r--r--test cases/unit/113 complex link cases/meson.build9
1 files changed, 9 insertions, 0 deletions
diff --git a/test cases/unit/113 complex link cases/meson.build b/test cases/unit/113 complex link cases/meson.build
index d3387c2..31753ed 100644
--- a/test cases/unit/113 complex link cases/meson.build
+++ b/test cases/unit/113 complex link cases/meson.build
@@ -38,3 +38,12 @@ s1 = static_library('t6-s1', 's1.c')
s2 = static_library('t6-s2', 's2.c', link_with: s1, install: true)
s3 = static_library('t6-s3', 's3.c', link_with: s2, install: true)
e = executable('t6-e1', 'main.c', link_with: s3)
+
+# Regression test: s1 gets promoted to link_whole and that used to make all other
+# libraries in the list (s2) to be ignored.
+# Executable only needs to link with s3.
+# See https://github.com/mesonbuild/meson/issues/11956.
+s1 = static_library('t7-s1', 's1.c')
+s2 = static_library('t7-s2', 's2.c')
+s3 = static_library('t7-s3', 's3.c', link_with: [s1, s2], install: true)
+e = executable('t7-e1', 'main.c', link_with: s3)