cmake: set g++ related compiler option only when compiler is g++