cmake: handle warning flags properly (thanks to hgs3 for pointers.) fixes https://github.com/libsdl-org/SDL/issues/4983