⚗️ do not use too old compilers with C++17

This commit is contained in:
Niels Lohmann 2021-10-20 15:18:00 +02:00
parent 5cd67e7d23
commit 12bb88871e
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69
4 changed files with 7 additions and 3 deletions

View File

@ -54,7 +54,7 @@
#endif
// std::filesystem does not work on MinGW GCC 8: https://sourceforge.net/p/mingw-w64/bugs/737/
#if __MINGW32__ && __GNUC__ == 8
#if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ == 8
#undef JSON_STD_FILESYSTEM_EXPERIMENTAL
#endif
#endif

View File

@ -2342,7 +2342,7 @@ using is_detected_convertible =
#endif
// std::filesystem does not work on MinGW GCC 8: https://sourceforge.net/p/mingw-w64/bugs/737/
#if __MINGW32__ && __GNUC__ == 8
#if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ == 8
#undef JSON_STD_FILESYSTEM_EXPERIMENTAL
#endif
#endif

View File

@ -58,6 +58,10 @@ foreach(feature ${CMAKE_CXX_COMPILE_FEATURES})
set(compiler_supports_cpp_17 TRUE)
endif()
endforeach()
# Clang only supports C++17 starting from Clang 5.0
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
unset(compiler_supports_cpp_17)
endif()
file(GLOB files src/unit-*.cpp)

View File

@ -64,7 +64,7 @@ using ordered_json = nlohmann::ordered_json;
#define JSON_STD_FILESYSTEM_EXPERIMENTAL 0
// std::filesystem does not work on MinGW GCC 8: https://sourceforge.net/p/mingw-w64/bugs/737/
#if __MINGW32__ && __GNUC__ == 8
#if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ == 8
#undef JSON_STD_FILESYSTEM_EXPERIMENTAL
#endif
#endif