MSVC C langauge target_compile_features
Could MSVC be made to work with target_compile_features for C language features? I assume we would need an MSVC-C.cmake file with definitions. At a glance I imagine something simple would do?
- C90 available for all supported MSVC
- C99 supported/default from MSVC 18.0 = 2013 (https://blogs.msdn.microsoft.com/vcblog/2013/07/19/c99-library-support-in-visual-studio-2013/)
- C11 not supported
There are no compile flags (like MSVC-CXX.cmake) and some of the C99 features have been supported back to MSVC 2005/2008.
I am not familiar enough with this area to provide a high quality pull req without some guidance. I assume some things might be refactored from MSVC-CXX.cmake to use.
I am sure this has problems but this seems to work for me:
include(Compiler/CMakeCommonCompilerMacros) set(CMAKE_C90_STANDARD_COMPILER_OPTION "") set(CMAKE_C90_EXTENSION_COMPILER_OPTION "") set(CMAKE_C99_STANDARD_COMPILER_OPTION "") set(CMAKE_C99_EXTENSION_COMPILER_OPTION "") __compiler_check_default_language_standard(C 16.0 90 18.0 99)