summaryrefslogtreecommitdiffstats
path: root/cmake/detect_cxx_version.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:39:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:39:03 +0000
commit408c608fc7bf1557ee987dd7fbe662fabed21a53 (patch)
tree8b07135336de378134bfedc808d49747174810d3 /cmake/detect_cxx_version.cmake
parentInitial commit. (diff)
downloadfrozen-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.cmake45
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()