I currently find it useful to use #+build window to place platform-specific code into separate files. Now I’d like to target a certain category of devices that isn’t tied to a specific OS or architecture. For example, in my project it would be helpful to apply the same approach to distinguish between headless and non-headless devices.
I haven’t found a way to do this yet. I’m still pretty new to this area, so it’s possible I’m missing an existing design or convention that intentionally avoids this kind of setup.
Apologies in advance if that’s the case, thanks for your help!
My understanding is that only code that is actually used when compiled is pulled into the binary. Unused imports should be ignored. It seems that way at least for Odin libraries. Not sure about foreign ones.
I have a scratch project with just about everything in Odin imported so I can quickly throw something together. If I have an empty main, the resulting binary is the same size as it is if I remove all the unused imports.
Others with more experience in this area could probably correct me or explain it better.