diff openmp/cmake/config-ix.cmake @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 1d019706d866
children 1f2b6ac9f198
line wrap: on
line diff
--- a/openmp/cmake/config-ix.cmake	Wed Jul 21 10:27:27 2021 +0900
+++ b/openmp/cmake/config-ix.cmake	Wed Nov 09 17:45:10 2022 +0900
@@ -1,4 +1,20 @@
 include(CheckCXXCompilerFlag)
+include(CheckCXXSourceCompiles)
+
+# Check for oneAPI compiler (some older CMake versions detect as Clang)
+if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
+  check_cxx_source_compiles("#if (defined(__INTEL_CLANG_COMPILER) || defined(__INTEL_LLVM_COMPILER))
+                             int main() { return 0; }
+                             #else
+                             not oneAPI
+                             #endif" OPENMP_HAVE_ONEAPI_COMPILER)
+  if (OPENMP_HAVE_ONEAPI_COMPILER)
+    # According to CMake documentation, the compiler id should
+    # be IntelLLVM when detected oneAPI
+    set(CMAKE_C_COMPILER_ID "IntelLLVM")
+    set(CMAKE_CXX_COMPILER_ID "IntelLLVM")
+  endif()
+endif()
 
 check_cxx_compiler_flag(-Wall OPENMP_HAVE_WALL_FLAG)
 check_cxx_compiler_flag(-Werror OPENMP_HAVE_WERROR_FLAG)
@@ -10,9 +26,9 @@
 check_cxx_compiler_flag(-Wsign-compare OPENMP_HAVE_WSIGN_COMPARE_FLAG)
 
 # Warnings that we want to disable because they are too verbose or fragile.
+check_cxx_compiler_flag(-Wno-enum-constexpr-conversion OPENMP_HAVE_WNO_ENUM_CONSTEXPR_CONVERSION_FLAG)
 check_cxx_compiler_flag(-Wno-extra OPENMP_HAVE_WNO_EXTRA_FLAG)
 check_cxx_compiler_flag(-Wno-pedantic OPENMP_HAVE_WNO_PEDANTIC_FLAG)
 check_cxx_compiler_flag(-Wno-maybe-uninitialized OPENMP_HAVE_WNO_MAYBE_UNINITIALIZED_FLAG)
 
-check_cxx_compiler_flag(-std=gnu++14 OPENMP_HAVE_STD_GNUPP14_FLAG)
-check_cxx_compiler_flag(-std=c++14 OPENMP_HAVE_STD_CPP14_FLAG)
+check_cxx_compiler_flag(-std=c++17 OPENMP_HAVE_STD_CPP17_FLAG)