[cmake] only set -Og if compiler supports it