Search code examples
rustbuildrust-cargo

How to select a C/C++ compiler for a Rust Cargo dependency module


Problem is that it automatically tries to call cc-rs with msvc compiler, but I only have a MSYS2's GCC:

[dependencies]
bevy = "0.5.0"

TARGET = Some("x86_64-pc-windows-msvc")

error occurred: Failed to find tool. Is cl.exe installed?

Is there a way to set CC option for dependencies?


Solution

  • So, yeah, x86_64-pc-windows-msvc toolchain was installed by default and with it you can't do anything (And strangely, even after the full MSVC installation it didn't work, linker panicked without giving any reason why)

    After installing and defaulting to x86_64-pc-windows-gnu toolchain everything worked well