Check CMakeVersion for C17 compile
CMake before 3.21 didn't have c17 as a CMAKE_C_STANDARD so skip
this test in that environment. Closes
@@ -72,7 +72,11 @@ if (${CLAP_BUILD_TESTS})
clap_compile_cpp(c11 c 11 11)
clap_compile_cpp(cpp11 cc 11 11)
clap_compile_cpp(cpp14 cc 11 14)
+ if(${CMAKE_VERSION} VERSION_LESS "3.21")
+ message(STATUS "Skipping C17 tests due to older CMAKE_VERSION ${CMAKE_VERSION}")
+ else()
clap_compile_cpp(c17 c 17 17)
+ endif()
clap_compile_cpp(cpp17 cc 17 17)
clap_compile_cpp(cpp20 cc 17 20)
