summaryrefslogtreecommitdiff
path: root/test cases/rust/4 polyglot/prog.c
diff options
context:
space:
mode:
authorAdam C. Foltzer <acfoltzer@galois.com>2017-06-09 14:51:58 -0700
committerAdam C. Foltzer <acfoltzer@galois.com>2017-06-09 15:14:02 -0700
commitbdd4c45b173055931db1c758cd7f016693d3a924 (patch)
treea868e261a3771996dbd3c1dd03c5bac049f60389 /test cases/rust/4 polyglot/prog.c
parent22cfd44221ada3219d9096e15dc8b00d32e0f9f6 (diff)
downloadmeson-bdd4c45b173055931db1c758cd7f016693d3a924.tar.gz
Enhance Rust support
- Adds a `crate_type` kwarg to library targets, allowing the different types of Rust [linkage][1]. - Shared libraries use the `dylib` crate type by default, but can also be `cdylib` - Static libraries use the `rlib` crate type by default, but can also be `staticlib` - If any Rust target has shared library dependencies, add the appropriate linker arguments, including rpath for the sysroot of the Rust compiler [1]: https://doc.rust-lang.org/reference/linkage.html
Diffstat (limited to 'test cases/rust/4 polyglot/prog.c')
-rw-r--r--test cases/rust/4 polyglot/prog.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test cases/rust/4 polyglot/prog.c b/test cases/rust/4 polyglot/prog.c
new file mode 100644
index 000000000..18f2c36fc
--- /dev/null
+++ b/test cases/rust/4 polyglot/prog.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+void f();
+
+int main() {
+ printf("Hello from C!\n");
+ f();
+}