GCC 11 and target_compile_features() - the 'standard' option doesn't pass
Hi! Tested on GCC 11.1, GCC 11.2, GCC 10.3.0
cmake_minimum_required(VERSION 3.8)
project(prog)
add_executable(${PROJECT_NAME} prog.cpp)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
with GCC 11 prints:
VERBOSE=1 make
...
make[2]: Entering directory '/workdir/b5'
[ 50%] Building CXX object CMakeFiles/prog.dir/prog.cpp.o
/usr/local/bin/c++ -o CMakeFiles/prog.dir/prog.cpp.o -c /workdir/prog.cpp
...
with GCC 10 prints:
VERBOSE=1 make
...
[ 50%] Building CXX object CMakeFiles/prog.dir/prog.cpp.o
/usr/local/bin/c++ -std=gnu++17 -o CMakeFiles/prog.dir/prog.cpp.o -c /workdir/prog.cpp
...
As we can see, no -std=gnu++17
option passed for GCC 11. It happens for other (c++11 etc) options as well.
Edited by antmak