Closed roblabla closed 3 years ago
Okay so I uhh reorganised the thing, and it'd be great if you could test it on your end again.
Notably behaviourally:
*-pc-windows-gnu
tries *-w64-mingw32-windres
, so we don't care what ports NT gets in future,*-pc-windows-gnu
tries llvm-rc
,RC_$TARGET
, RC_${TARGET//-/_}
, then RC
environment variables,New version doesn't work, there's two problems:
-xc
is not recognized by clang-cl. This only causes a warning, e.g. clang: warning: unknown argument ignored in clang-cl: '-xc' [-Wunknown-argument]
, but I fear it might not be compatible with some compilers, e.g. people running cl.exe under wine..preprocessed.rc
file does not get created. It looks like clang-cl -E
ignores -o
, and always prints the preprocessed file to stdout? Running a quick test, clang --driver-mode=cl -E test.c -o test.lol.c
on a simple C file did not create a test.lol.c
file, and indeed printed to stdout the preprocessed contents.EDIT: you can reproduce my toolchain with https://github.com/roblabla/msvc-wine#setting-up-this-toolchain-for-easy-cross-compilation-in-rust
Ah, I missed that MSVC is incompatible as a feature. I fell back to your original preprocess to pipe + fs::write()
method, could you try again, please?
It works!
Lovely, cheers!
Released in v1.5.0
!
This is a bit of a rough draft implementing support for compiling resource files with
llvm-rc
, so we can cross-compile from linux to windows.Something I noticed is that this crate will not embed the resource file when cross-compiling from linux with the MSVC target. The build won't fail, but the resulting executable won't have the resource. With this PR, cross-compiling for the windows targets will fail the build if the resource can't be embedded.
Fixes #29