diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:39:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:39:03 +0000 |
commit | 408c608fc7bf1557ee987dd7fbe662fabed21a53 (patch) | |
tree | 8b07135336de378134bfedc808d49747174810d3 /cmake/detect_cxx_version.cmake | |
parent | Initial commit. (diff) | |
download | frozen-408c608fc7bf1557ee987dd7fbe662fabed21a53.tar.xz frozen-408c608fc7bf1557ee987dd7fbe662fabed21a53.zip |
Adding upstream version 1.1.1.upstream/1.1.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/detect_cxx_version.cmake')
-rw-r--r-- | cmake/detect_cxx_version.cmake | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/cmake/detect_cxx_version.cmake b/cmake/detect_cxx_version.cmake new file mode 100644 index 0000000..2021650 --- /dev/null +++ b/cmake/detect_cxx_version.cmake @@ -0,0 +1,45 @@ +set(cxx17_minimum_msvc_version 19.14) +set(cxx17_minimum_gcc_version 7.0) +set(cxx17_minimum_clang_version 4.0) +set(cxx17_minimum_appleclang_version 6.0) + +set(cxx20_minimum_msvc_version 19.22) +set(cxx20_minimum_gcc_version 9.0) +set(cxx20_minimum_clang_version 7.0) +set(cxx20_minimum_appleclang_version 10.0) + +set(cxx_17_supported OFF) + +if(MSVC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${cxx17_minimum_msvc_version}) + set(cxx_17_supported ON) +endif() + +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${cxx17_minimum_gcc_version}) + set(cxx_17_supported ON) +endif() + +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${cxx17_minimum_clang_version}) + set(cxx_17_supported ON) +endif() + +if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${cxx17_minimum_appleclang_version}) + set(cxx_17_supported ON) +endif() + +set(cxx_20_supported OFF) + +if(MSVC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${cxx20_minimum_msvc_version}) + set(cxx_20_supported ON) +endif() + +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${cxx20_minimum_gcc_version}) + set(cxx_20_supported ON) +endif() + +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${cxx20_minimum_clang_version}) + set(cxx_20_supported ON) +endif() + +if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${cxx20_minimum_appleclang_version}) + set(cxx_20_supported ON) +endif() |