I'm trying to use a linker script to include a binary as a static variable in my code. At the moment, I am calling include_bytes on "binary.xz".
I want to change my compression algorithm and start calling include_bytes on "binary.gz", but only in specific scenarios. In my mind, the way I want to do this is by checking if "binary.gz" exists, and if yes, including it, otherwise using "binary.xz".
The simplest way is probably to check this in build.rs and emit the file with either include_bytes!("binary.gz") or include_bytes!("binary.xz"), which will be then include!d into the actual code.
Oh I was having some complications in my build.rs , so I was trying to do the check in my Makefile. But for whatever reason, wildcard is not returning the output that is expected.