diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index 399b818fc20..b43671cc216 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 diff --git a/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake b/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake index 6f55450c3af..153c51bae71 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)