-
Notifications
You must be signed in to change notification settings - Fork 297
add support for appleclang and update cmake #582
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
base: trunk
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| cmake_minimum_required(VERSION 3.10) | ||
| cmake_minimum_required(VERSION 3.5) | ||
| project(cassandra C CXX) | ||
|
|
||
| set(CASS_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
@@ -162,6 +162,7 @@ endif() | |
| #------------------------ | ||
|
|
||
| if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR | ||
| "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR | ||
| "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") | ||
| # Enable C++11 support to use std::atomic | ||
| if(CASS_USE_STD_ATOMIC) | ||
|
|
@@ -177,7 +178,8 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR | |
| endif() | ||
| endif() | ||
|
|
||
| if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") | ||
| if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR | ||
| "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll let him speak on this for sure but I believe @yifan-c was able to get this working more generally using regex matching: That's probably more desirable as it covers a broader range of clang derivatives. cmake supports a number of such variants so as long as the flags in question apply to clang generally (i.e. isn't some custom flag implemented for a specific clang variant) the more general syntax seems preferrable. |
||
| # Clang/Intel specific compiler options | ||
| # I disabled long-long warning because boost generates about 50 such warnings | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Wno-long-long -Wno-unused-parameter") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on a couple things here?
First: why is it necessary to change the cmake minimum version at all in order to fix this?
Second: if it is necessary to change it why are we tweaking it only in three CMakeLists files rather than uniformly throughout the project?