From ac764f0fb482fa8025071e642713bb2bb4d6674d Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Tue, 5 Aug 2025 10:40:30 +0100 Subject: [PATCH] Update minimum CMake version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The use of CACHE in the SNMALLOC_STATIC_LIBRARY_PREFIX was not correctly handled by cmake before 3.21. > The “set(CACHE)” command no longer removes a normal variable of the same name, if any. See policy “CMP0126”. Changing the minimum version means that containing projects can do: ```CMake set(SNMALLOC_STATIC_LIBRARY_PREFIX "my_prefix") ``` Without this, there were weird behaviours that the first compile used "sn_" and then subsequent compiles used "my_prefix". Thanks to @achamayou for debugging this in CCF. https://github.com/microsoft/CCF/pull/7161 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69864469c..1a401fabc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.21) project(snmalloc CXX) if (NOT CMAKE_BUILD_TYPE)