diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2023-04-27 10:30:19 -0400 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2023-05-01 12:57:45 -0400 |
commit | 2dadc3ae5befade53c38c314344b7bd6f2aca3f4 (patch) | |
tree | 76dc2b9f7c5751ab7867ff106577161c6c5eb24d /test cases | |
parent | a78af236862008f284d84ab9327a38886e086d8c (diff) | |
download | meson-2dadc3ae5befade53c38c314344b7bd6f2aca3f4.zip meson-2dadc3ae5befade53c38c314344b7bd6f2aca3f4.tar.gz meson-2dadc3ae5befade53c38c314344b7bd6f2aca3f4.tar.bz2 |
Rust: C static library cannot link_whole Rust static library
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/rust/5 polyglot static/meson.build | 13 | ||||
-rw-r--r-- | test cases/rust/5 polyglot static/test.json | 3 |
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 bed7977..20cef38 100644 --- a/test cases/rust/5 polyglot static/meson.build +++ b/test cases/rust/5 polyglot static/meson.build @@ -9,7 +9,18 @@ deps = [ extra_winlibs = meson.get_compiler('c').get_id() in ['msvc', 'clang-cl'] ? ['userenv.lib', 'ws2_32.lib', 'bcrypt.lib'] : [] 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', dependencies: deps, link_with : l, diff --git a/test cases/rust/5 polyglot static/test.json b/test cases/rust/5 polyglot static/test.json index cc0d2da..135300d 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"} ] } |