Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmake] fix condition for apple clang #2051

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ if(POLICY CMP0022)
cmake_policy(SET CMP0022 NEW)
endif()

# Compiler id for Apple Clang is now AppleClang
if(POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif()

# Foo::Bar always refers to an IMPORTED target
if(POLICY CMP0028)
cmake_policy(SET CMP0028 NEW)
Expand Down
2 changes: 1 addition & 1 deletion cmake/OpenMP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ endif()
set(OpenMP_cmake_included true)
include("cmake/Threading.cmake")

if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently this check applied to all Clangs on macOS, after the change only to Apple provided Clang. If we want to retain the old logic, then MATCHES would be a better option like: if (APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang"). It should catch both Clangs.

# OSX Clang doesn't have OpenMP by default.
# But we still want to build the library.
set(_omp_severity "WARNING")
Expand Down
Loading