From e190e7944e42309a60b31c9d025c877219e7f878 Mon Sep 17 00:00:00 2001 From: Victor Zhang Date: Mon, 9 Dec 2024 10:53:38 -0800 Subject: [PATCH 1/2] Update cmake minimum requirement to 3.10 CMake warns on the current minimum requirement (3.5). Update to 3.10. This means support is still available for the default on Ubuntu 18.04, which exited LTS standard in April of 2023. [draft] --- build/cmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index 399b818fc..b43671cc2 100644 --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -7,7 +7,7 @@ # in the COPYING file in the root directory of this source tree). # ################################################################ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # As of 2018-12-26 ZSTD has been validated to build with cmake version 3.13.2 new policies. # Set and use the newest cmake policies that are validated to work From 1198a582d3c931c7faba149cbf1b48910da3f256 Mon Sep 17 00:00:00 2001 From: Victor Zhang Date: Thu, 12 Dec 2024 11:39:40 -0800 Subject: [PATCH 2/2] Update VERSION_LESS usage to VERSION_GREATER_THAN --- build/cmake/CMakeModules/AddZstdCompilationFlags.cmake | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake b/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake index 6f55450c3..153c51bae 100644 --- a/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake +++ b/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake @@ -1,11 +1,10 @@ include(CheckCXXCompilerFlag) include(CheckCCompilerFlag) -# VERSION_GREATER_EQUAL requires CMake 3.7 or later. -# https://cmake.org/cmake/help/latest/command/if.html#version-greater-equal -if (CMAKE_VERSION VERSION_LESS 3.18) - set(ZSTD_HAVE_CHECK_LINKER_FLAG false) -else () + +if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.18) set(ZSTD_HAVE_CHECK_LINKER_FLAG true) +else () + set(ZSTD_HAVE_CHECK_LINKER_FLAG false) endif () if (ZSTD_HAVE_CHECK_LINKER_FLAG) include(CheckLinkerFlag)