We currently have to use separate codebases to support different BC versions. This usually is done using Git branches.
Most of the code does not depend on platform version - for example table definition in BC22 is the pretty much matches one in BC19, same for other object types. The differences in code are only because platform has different functionality or application has different functionality. These differences could be processed using preprocessor directives but in current form they not really useful.
There needs to be a way to define several compiler configurations (maybe in app.json file), e.g:
"targets": {
"BC21CU5": { // for example some new functionality was added here
"runtime": "10.0", // mandatory property