summaryrefslogtreecommitdiff
path: root/test cases/rust
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2023-07-05 01:10:58 +0300
committerGitHub <noreply@github.com>2023-07-05 01:10:58 +0300
commitd391e5281c982899e17c7a5ceeca30262f1640ea (patch)
tree17d134e2b037d66f4e75468e552587b7d9b0b95d /test cases/rust
parent7fe6e18a02129d788cd29e6861b331341265f4c7 (diff)
parentff86e799a4d1119f51d7e7715944a2c87eaef509 (diff)
downloadmeson-d391e5281c982899e17c7a5ceeca30262f1640ea.tar.gz
Merge pull request #11742 from xclaesse/link-whole-cases
Fix niche cases when linking static libs
Diffstat (limited to 'test cases/rust')
-rw-r--r--test cases/rust/5 polyglot static/meson.build13
-rw-r--r--test cases/rust/5 polyglot static/test.json3
2 files changed, 13 insertions, 3 deletions
diff --git a/test cases/rust/5 polyglot static/meson.build b/test cases/rust/5 polyglot static/meson.build
index 9fbba6829..22c0cd00c 100644
--- a/test cases/rust/5 polyglot static/meson.build
+++ b/test cases/rust/5 polyglot static/meson.build
@@ -1,7 +1,18 @@
project('static rust and c polyglot executable', 'c', 'rust')
r = static_library('stuff', 'stuff.rs', rust_crate_type : 'staticlib')
-l = static_library('clib', 'clib.c', link_with : r, install : true)
+
+# clib is installed static library and stuff is not installed. That means that
+# to be usable clib must link_whole stuff. Meson automatically promote to link_whole,
+# as it would do with C libraries, but then cannot extract objects from stuff and
+# thus should error out.
+# FIXME: We should support this use-case in the future.
+testcase expect_error('Cannot link_whole a custom or Rust target into a static library')
+ l = static_library('clib', 'clib.c', link_with : r, install : true)
+endtestcase
+
+l = static_library('clib', 'clib.c', link_with : r)
+
e = executable('prog', 'prog.c',
link_with : l,
install : true)
diff --git a/test cases/rust/5 polyglot static/test.json b/test cases/rust/5 polyglot static/test.json
index cc0d2da7e..135300de5 100644
--- a/test cases/rust/5 polyglot static/test.json
+++ b/test cases/rust/5 polyglot static/test.json
@@ -1,7 +1,6 @@
{
"installed": [
{"type": "exe", "file": "usr/bin/prog"},
- {"type": "pdb", "file": "usr/bin/prog"},
- {"type": "file", "file": "usr/lib/libclib.a"}
+ {"type": "pdb", "file": "usr/bin/prog"}
]
}