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
166 stars 29 forks source link

Pass /no-preprocess flag to llvm-rc 16+ #64

Closed roblabla closed 6 months ago

roblabla commented 6 months ago

Since LLVM 16, llvm-rc supports doing the preprocessing itself. However, doing so requires having clang in the PATH, which some more complex toolchain may not necessarily have (for instance, for windows, you may have clang-cl but no clang in PATH, or you may have a target-prefixed clang like x86_64-pc-windows-msvc-clang).

If llvm-rc fails to find clang, it will error out with a message saying it failed to find the program in PATH.

To avoid these issues, we continue doing the preprocessing manually, and pass the /no-preprocess flag to llvm-rc if it is supported.

nabijaczleweli commented 6 months ago

It's so funny that a substring search is not part of the standard library. Validated against llvm trunk 1:18~++20231231112334+c7c912cff945-1\~exp1\~20231231112352.433. Applied with minor editorial changes as 25a77c465195ba555eb5e7ba51def485f774eeb9.

Please close if you can, closing hasn't worked for me in weeks.

nabijaczleweli commented 6 months ago

Released in v2.4.1, backported to v1.6.12.

roblabla commented 6 months ago

Thanks :)