Closed sadko4u closed 1 year ago
Well I suppose, waggishly, I could say that the test accurately shows that the 17 standard does indeed not compile on your system, so it has worked? Chuckle.
The more correct fix is to have https://github.com/free-audio/clap/blob/d6cbd4fd6540e80be816994f6f6bccc7933998ef/CMakeLists.txt#L75 that line either knock out those tests for older gcc or to do a pre-build test where it tries to compile with those flags using a can compile cmake check before it adds the target.
Oh I actually diagnosed it slightly incorrectly
https://cmake.org/cmake/help/latest/prop_tgt/C_STANDARD.html
the C_STANDARD 17 only is available as of CMake 3.21 so in this case we need to check CMAKE_VERSION there not compiler version.
So specifically
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()
but i don't have any way to test that to see if it works.
@sadko4u please can you test?
Verified. Yes, that worked. At least, CMAKE didn't give any error message.
Great. @abique need me to make a PR from it or can you get it with the other 1.1.7 changes?
Tossed in the change as PR #275 @abique
System:
Command:
cmake .. -G Ninja -DCLAP_BUILD_TESTS=ON
Actual output:
GCC version:
CMAKE version: