mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 14:20:06 -06:00
FindOpenMP: Handle non-Apple clang on macOS
I was noticing that FindOpenMP was failing to find my openmp installation on macos when building with a custom-compiled clang. Upon inspection it appears that FindOpenMP is looking for `AppleClang` as a compiler identification and the `Clang` case is only applicable for Win32. Try to fix that by treating custom `Clang` on macos the same as `AppleClang`.
This commit is contained in:
@@ -298,8 +298,9 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR)
|
||||
set("${OPENMP_LIB_NAMES_VAR}" "" PARENT_SCOPE)
|
||||
endif()
|
||||
break()
|
||||
elseif(CMAKE_${LANG}_COMPILER_ID STREQUAL "AppleClang"
|
||||
AND CMAKE_${LANG}_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
|
||||
elseif((CMAKE_${LANG}_COMPILER_ID STREQUAL "AppleClang"
|
||||
AND CMAKE_${LANG}_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0") OR
|
||||
(CMAKE_${LANG}_COMPILER_ID STREQUAL "Clang" AND APPLE))
|
||||
|
||||
# Check for separate OpenMP library on AppleClang 7+
|
||||
find_library(OpenMP_libomp_LIBRARY
|
||||
|
||||
Reference in New Issue
Block a user