Build Scripts: Selecting files which will be built?

โš“ Rust    ๐Ÿ“… 2025-06-12    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 5      

surdeus

Warning

This post was published 65 days ago. The information described in this article may have changed.

Hello.

I am building a library that has different backends. I have created a build script which checks the BACKEND and BINDINGS enviroment variables and saves it as a variable, but now I need to select which file to use.

I want to avoid changing more files other than the build.rs, but if that is not possible, I don't mind having to edit extra files.

The BACKEND and BINDINGS files are not the same, so I have to be able to select both.

My file structure:
v src/
| v backends/
| | v bindings/
| | | libalpm.rs
| | | null.rs
| | | mod.rs
| | v modules/
| | | arch.rs
| | | null.rs
| | ยท mod.rs
| ยท mod.rs
| build.rs
ยท lib.rs
Cargo.toml

Thanks,
Clue

3 posts - 2 participants

Read full topic

๐Ÿท๏ธ rust_feed