Skip to content

Commit

Permalink
Merge #245: [FIXUP] cmake: Enable CMP0141 policy after `cmake_minimum…
Browse files Browse the repository at this point in the history
…_required()`

af5e6b4 [FIXUP] cmake: Enable CMP0141 policy after `cmake_minimum_required()` (Hennadii Stepanov)

Pull request description:

  Otherwise, the policy setting won't get any effect.

  See https://cmake.org/cmake/help/latest/policy/CMP0141.html

  ---

  After #215, the `CMAKE_MSVC_DEBUG_INFORMATION_FORMAT` CMake's abstraction is not used in our code directly, but it is still convenient for the user to be able to use it when configuring the build system from the command line or an IDE.

  ---

  This change can be easily verified on any system (not Windows only) by injecting the following commands:
  ```cmake
  cmake_policy(GET CMP0141 result)
  message("${result}")
  ```

ACKs for top commit:
  m3dwards:
    ACK af5e6b4

Tree-SHA512: 98dccc7f97b3b496a121a6e0961b60c344a2bc7f2e19193ea1936a9776c5ebf7eec6c47e6159332997b48ea2ce3220a801054c3c9d1d8c7be927add4458bfb92
  • Loading branch information
hebasto committed Jun 29, 2024
2 parents e05358e + af5e6b4 commit 8948ba8
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 @@ -7,13 +7,13 @@
#
# Centos Stream 9, EOL in May 2027:
# - CMake 3.26.5, https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/
cmake_minimum_required(VERSION 3.22)
if(POLICY CMP0141)
# MSVC debug information format flags are selected by an abstraction.
# We want to use the CMAKE_MSVC_DEBUG_INFORMATION_FORMAT variable
# to select the MSVC debug information format.
cmake_policy(SET CMP0141 NEW)
endif()
cmake_minimum_required(VERSION 3.22)

#=============================
# Project / Package metadata
Expand Down

0 comments on commit 8948ba8

Please sign in to comment.