From c91437bae3a9aef1e235a0dc00669dc91a76c6e3 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 15 Dec 2024 10:16:01 +0000 Subject: [PATCH] Update cmake_minimum_required to avoid warnings on sid. The new (ish) "3.7...3.28" syntax means: cmake will give up with a fatal error if you try to build with a version older than 3.7, but also, it won't turn on any new behaviour introduced after 3.28 (which is the cmake version in Ubuntu 24.04, where I'm currently doing both my development and production builds). Without this, cmake 3.31 (found on Debian sid) will give a warning at configure time: "Compatibility with CMake < 3.10 will be removed from a future version of CMake." I guess the point is that they're planning to make breaking changes that arrange that you _can't_ make the same CMakeLists work with both 3.7 and this potential newer version. So by specifying 3.28 as the "max" version, we avoid those breaking changes affecting us, for the moment. Our "old distro support" policy is currently that we still want to be able to (and indeed I actually test it before each release) build on Debian stretch, which is still in support, albeit a very marginal paid-LTS kind of support. So we do still need to support cmake 3.7. This seems to be a plausible way to get that to carry on working, while not provoking annoying warnings from cmake 3.31, or risking the actual breaking change when it comes, whatever it is. (Fun fact: cmake 3.7 doesn't actually _understand_ this 3.7...3.28 syntax! That syntax itself was introduced in 3.12. But the cmake manual explains that it's harmless to earlier versions, which will interpret the extra dots as separating additional version components, and ignore them. :-) --- CMakeLists.txt | 2 +- doc/CMakeLists.txt | 2 +- test/sclog/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 314b7f6a..dad26e03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.7...3.28) project(putty LANGUAGES C) set(CMAKE_C_STANDARD 99) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index ef77eb12..35673996 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.7...3.28) project(putty-documentation LANGUAGES) # This build script can be run standalone, or included as a diff --git a/test/sclog/CMakeLists.txt b/test/sclog/CMakeLists.txt index 8a8ac570..9f9f75f9 100644 --- a/test/sclog/CMakeLists.txt +++ b/test/sclog/CMakeLists.txt @@ -2,7 +2,7 @@ # goes with the PuTTY test binary 'testsc'. For build instructions see # the comment at the top of testsc.c. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.7...3.28) project(sclog LANGUAGES C)