nabijaczleweli / rust-embed-resource

A Cargo build script library to handle compilation and inclusion of Windows resources, in the most resilient fashion imaginable
MIT License
173 stars 29 forks source link

Build target linking errors #19

Closed WeaponMan closed 4 years ago

WeaponMan commented 4 years ago

In order to build for gnu target you need to switch default-host to gnu target if you have msvc target as default. My understanding the build.rs is build with default-host so if you build with cargo build --target=x86_64-pc-windows-gnu and have selected default-host x86_64-pc-windows-msvc it fails to link.

I think the checks for target must be runtime instead of compile time in order this to work. (I just don't really know if there is another way to get cargo build --target to build build.rs with that selected target)

nabijaczleweli commented 4 years ago

How about cargo +stable-x86_64-pc-windows-gnu build?

WeaponMan commented 4 years ago

Yeah, thats works. It saves time switching between default-hosts. Thank you