Thanks for the pointer , I have been missing that thread!
Yes, the invalid flag cause a compile error because CMake tries to add -std=C++11 to regular C files.
I have tested it compiling manually (I don’t have CLion) but I think that the error will be just the same on compiling with CLion.
target_compile_options(TARGET PRIVATE -std=c++11) is not the proper way to get C++11 support, especially since the C compiler doesn’t know what that option means and fails.
You should use the following instead:
set_target_properties(TARGET PROPERTIES
CXX_STANDARD 11
CXX_EXTENSIONS OFF # to get -std=c++11 instead of -std=gnu++11
)