Have you ever built a cross-compatible game or CLI tool or the simple Russian Roulette game, I have as the banner for this article?
Well if you are wondering how I can target each operating system, sit back as I explain the wonders of conditional compilation and how it is done in Rust.
![#[cfg] Conditional Compilation in Rust](/img/backend-2023.jpg)
If you have ever built cross-compatible software you would not need this explanation; but for the rest of us. Conditional compilation is simply compiling only parts of code needed based on some given conditions