I have a separate version for flatpak builds in my app. Let's say I have a large project that builds with dub that goes like this:

import std.stdio;

void main()
{
        version (flatpak) {
                writeln(`Flatpak build`);
        } else {
                writeln("Edit source/app.d to start your project.");
        }
}

Now if I try `dub build --version=flatpak` it's not recognized by the compiler. How can I set the version __from command line__ before building my project? I cannot depend on dflags inside dub.json because dub.json has no idea whether if it's being parsed in a flatpak version build or a regular build.

Reply via email to