Skip to content

Commit

Permalink
cmake: call cmake_minimum_required() before project()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
LDVG committed Aug 30, 2023
1 parent 79fd7bd commit bcbde20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bcbde20

Please sign in to comment.