meson/test cases/rust/20 rust and cpp
Dylan Baker 6bfb47a455 rust: Override the default MSVCRT when linking Rust and !rust together
Rust by default links with the default MSVCRT, (dynamic, release).
MSVCRT's cannot be mixed, so if Meson compiles a C or C++ library and
links it with the debug MSVCRT, then tries to link that with the Rust
library there will be failures. There is no built-in way to fix this for
rustc, so as a workaround we inject the correct arguments early in the
linker line (before any libs at least) to change the runtime. This seems
to work and is recommended as workaround in the upstream rust bug
report: https://github.com/rust-lang/rust/issues/39016.

Given that this bug report has been opened since 2017, it seems unlikely
to be fixed anytime soon, and affects all (currently) released versions
of Rust.
2023-06-27 11:53:18 -07:00
..
lib.cpp rust: get stdlib arguments for non-rust languages when linking 2023-06-27 11:53:18 -07:00
lib.hpp rust: get stdlib arguments for non-rust languages when linking 2023-06-27 11:53:18 -07:00
main.rs rust: get stdlib arguments for non-rust languages when linking 2023-06-27 11:53:18 -07:00
meson.build rust: get stdlib arguments for non-rust languages when linking 2023-06-27 11:53:18 -07:00
test.json rust: Override the default MSVCRT when linking Rust and !rust together 2023-06-27 11:53:18 -07:00