Native binaries: how to disable/control built artifacts

I’ve found this suggestion:

…which seems to work for specifically disabling a type of binary, and presumably I could add other variant condition tests to selectively disable a build based on runtime properties.

Is this still the best way to achieve what I’m looking for?

Thanks!