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?

@toptobes toptobes Jun 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looking at the git logs, I'm fairly certain what happened is that they were originally basing this off the version of the c++ driver 2 weeks before this PR was created, when it was still using cmake version 2.8.12 (so this was intended as an upgrade, not a downgrade)

See:

 git lg                               
* a22a11a3 golddevelopment - (HEAD -> gold-development/trunk) add support for appleclang and update cmake (5 months ago)
* e5a486ac Sigmanificient - Bump minimum required version for cmake4 compatibility (5 months ago)
 git lg -L 1,1:CMakeLists.txt                    
* a22a11a3 golddevelopment - (HEAD -> gold-development/trunk) add support for appleclang and update cmake (5 months ago)| 
| diff --git a/CMakeLists.txt b/CMakeLists.txt
| --- a/CMakeLists.txt
| +++ b/CMakeLists.txt
| @@ -1,1 +1,1 @@
| -cmake_minimum_required(VERSION 3.10)
| +cmake_minimum_required(VERSION 3.5)

* e5a486ac Sigmanificient - Bump minimum required version for cmake4 compatibility (5 months ago)| 
| diff --git a/CMakeLists.txt b/CMakeLists.txt
| --- a/CMakeLists.txt
| +++ b/CMakeLists.txt
| @@ -1,1 +1,1 @@
| -cmake_minimum_required(VERSION 2.8.12)
| +cmake_minimum_required(VERSION 3.10)

P.S. AppleClang only got differentiated from Clang in 3.0 which is why this wasn't an issue previously

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.

This seems reasonable @toptobes but even if it is the case I'd still argue for a uniform cmake requirement throughout the project. Note the commit referenced above; in that case we updated cmake_minimum_required() throughout the project. If we're going to change the cmake requirement at all here it seems like we should do the same.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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")

@absurdfarce absurdfarce Mar 25, 2026

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.

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