Detect and set CXX flags separately