Support Clang variants (including AppleClang) for cmake builds#586
Support Clang variants (including AppleClang) for cmake builds#586toptobes wants to merge 1 commit into
Conversation
|
Note: this is a fix for CASSCPP-2 Kicked off a Jenkins run just to make sure there isn't some weird regression here (but I'm not expecting anything). |
There was a problem hiding this comment.
Pull request overview
This PR updates the CMake compiler detection logic to treat all Clang-family compiler IDs (including AppleClang) as “Clang” for the purposes of enabling Clang-specific flags and feature checks, improving build support on macOS and other Clang variants.
Changes:
- Switched
CMAKE_CXX_COMPILER_IDchecks fromSTREQUAL "Clang"toMATCHES "Clang$"in the top-level CMake logic. - Applied the same Clang-variant matching in
src/CMakeLists.txtso warning/-Werrorflags are consistently enabled for AppleClang and other Clang variants.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| CMakeLists.txt | Broadens Clang detection to include all *Clang compiler IDs for atomics selection and top-level compiler flags. |
| src/CMakeLists.txt | Broadens Clang detection to include all *Clang compiler IDs for Clang-specific warning flags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") | ||
| if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$") | ||
| # Clang/Intel specific compiler options |
There was a problem hiding this comment.
I mean, I guess... but this seems far from necessary to me
|
This is the second time now that I've accidentally triggered a Copilot review... I think I'm hitting one of the reviewer buttons (with Copilot selected as a default) thinking I can then select my reviewer and then realizing I've just asked Copilot to review A Thing ™️. |
With CMake 3.0,
AppleClangis now a separate compiler target which needs to be explicitly accounted for to allow the driver to easily be built on Mac, and as per further discussion with Brett, we've decided to allow all clang variants here using"${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$", and if any of them end up having any unfortunate issues with flag compatibility, we can deal with them on a case-by-case basisBuild succeeds on