Skip to content
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
6 changes: 4 additions & 2 deletions CMakeLists.txt
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)
Copy link
Copy Markdown
Contributor

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?

project(cassandra C CXX)

set(CASS_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down Expand Up @@ -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)
Expand All @@ -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")
Copy link
Copy Markdown
Contributor

@absurdfarce absurdfarce Mar 25, 2026

Choose a reason for hiding this comment

The 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:

if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$" 

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")
Expand Down
2 changes: 1 addition & 1 deletion cmake/ClangFormat.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Format and verify formatting using clang-format
#
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.5)

include(FindPackageHandleStandardArgs)

Expand Down
2 changes: 1 addition & 1 deletion src/third_party/sparsehash/CMakeLists.txt
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)

include(CheckCXXSourceCompiles)
include(CheckFunctionExists)
Expand Down