Our project is using STM32 GCC ARM Toolchain, using STM32 CMake toolchain file (gcc-arm-none-eabi.cmake) which sets the CMAKE_C_COMPILER_ID
and CMAKE_CXX_COMPILER_ID
to GNU
.
When lines like this are encountered target_compile_features(my_lib PUBLIC cxx_std_11)
it complains that ...
target_compile_features no known features for CXX compiler
"GNU"
version 11.3.1.
I first noticed this when trying to pull in Boost with their CMake files, which use the same target_compile_feature
checks.
The CMake project does configure for Linux GCC. My CMake version is 3.30.2.
Removing CMAKE_C_COMPILER_FORCED
and CMAKE_CXX_COMPILER_FORCED
being set to TRUE (removing those options altogether) from our toolchain file fixed the errors above. I'm not sure if our project added those options or if they were form STM32 CubeMX generated files. Those options are listed as deprecated in CMake docs.