From 8a40cbb77f9671104277ee5eeb38f2d5b4633841 Mon Sep 17 00:00:00 2001 From: Alastair Houghton Date: Fri, 12 Apr 2024 10:01:54 +0100 Subject: [PATCH] [Build] Fix host system query for older CMake. `DISTRIB_PRETTY_NAME` is only supported on CMake 3.22 and later, but we only require CMake 3.19.6. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38d01c03e994e..316f602ca4205 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -962,7 +962,9 @@ endif() # Check what linux distribution is being used. # This can be used to determine the default linker to use. -cmake_host_system_information(RESULT DISTRO_NAME QUERY DISTRIB_PRETTY_NAME) +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.22") + cmake_host_system_information(RESULT DISTRO_NAME QUERY DISTRIB_PRETTY_NAME) +endif() # Which default linker to use. Prefer LLVM_USE_LINKER if it set, otherwise use # our own defaults. This should only be possible in a unified (not stand alone)