From 1701d1b5350a7e49e671be85e80cf71e65a2aeb0 Mon Sep 17 00:00:00 2001 From: David Gumberg Date: Wed, 28 May 2025 16:43:40 -0700 Subject: [PATCH 1/2] build: Requires C++-20 `std::is_standard_layout_v` (used in `util/no_destructor.h`) is not available until C++-17. This breaks building with some compilers. Tested with clang 20.1.6. https://github.com/google/leveldb/pull/1246 https://en.cppreference.com/w/cpp/types/is_standard_layout.html --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cfd4faa32..a3ce65616 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,8 @@ set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED OFF) set(CMAKE_C_EXTENSIONS OFF) -# This project requires C++11. -set(CMAKE_CXX_STANDARD 11) +# This project requires C++17. +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) From bb48a453dae5d1faf972201fbd037e387add3e5a Mon Sep 17 00:00:00 2001 From: David Gumberg Date: Wed, 11 Jun 2025 13:52:34 -0700 Subject: [PATCH 2/2] Build: bump CMake minimum required to 3.22 to match Core --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a3ce65616..f2632af46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. See the AUTHORS file for names of contributors. -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.22) # Keep the version below in sync with the one in db.h project(leveldb VERSION 1.22.0 LANGUAGES C CXX)