I’m using configuration files on SD.
By this I initialize Network and IO’s.
To do so I made a HW-Library which loads it’s GPIO’s and other IO related channels from an XML file.
The file contains the Pin, glitchfilter, … for GPIO’s.
I can also define a channel type, by which I can add special implementations for an SPI Analog in chip, …
Each board gets a different file and I can access the IO channels by name.
This should work at least over most/all premium or OSHW boards, but mixing this would be more complicated.
Alternatively you can use classic #if #else #endif
unfortunately there is no way to add multiple release configurations anymore as in VS6 (at least not that I know. But you can have multiple VS projects using the same code files, if the project files are in the same folder. You can define the defines in the project settings then. I use this if I need a library for NETMF and Windows.