From bcbde209b412f99f0178b2907a5c7eba62bfbd29 Mon Sep 17 00:00:00 2001 From: Ludvig Michaelsson Date: Wed, 30 Aug 2023 09:26:50 +0200 Subject: [PATCH] cmake: call cmake_minimum_required() before project() CMake documentation on cmake_minumum_required() [1] indicates Call the cmake_minimum_required() command at the beginning of the top-level CMakeLists.txt file even before calling the project() command. It is important to establish version and policy settings before invoking other commands whose behavior they may affect. [1] https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 870ffd59..f651b224 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,12 +2,12 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # SPDX-License-Identifier: BSD-2-Clause +cmake_minimum_required(VERSION 3.0) # detect AppleClang; needs to come before project() cmake_policy(SET CMP0025 NEW) project(libfido2 C) -cmake_minimum_required(VERSION 3.0) # Set PIE flags for POSITION_INDEPENDENT_CODE targets, added in CMake 3.14. if(POLICY CMP0083) cmake_policy(SET CMP0083 NEW)