]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: use new CMP0127 policy 44354/head
authorKefu Chai <tchaikov@gmail.com>
Sun, 19 Dec 2021 04:22:16 +0000 (12:22 +0800)
committerKefu Chai <tchaikov@gmail.com>
Sun, 19 Dec 2021 07:02:10 +0000 (15:02 +0800)
CMP0127 is a new policy introduced by CMake 3.22. without specifying
the policy, we'd have following warning when configuring the building
system using CMake 3.22:

CMake Warning (dev) at /usr/share/cmake-3.22/Modules/CMakeDependentOption.cmake:84 (message):
  Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
  Syntax.  Run "cmake --help-policy CMP0127" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  CMakeLists.txt:255 (CMAKE_DEPENDENT_OPTION)
This warning is for project developers.  Use -Wno-dev to suppress it.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
CMakeLists.txt

index 73547fe1ec916ffd4b593ae15f2b9a51970a3bbe..b5799cbc9af50784259091be1832fe484189d55d 100644 (file)
@@ -14,6 +14,9 @@ cmake_policy(SET CMP0065 NEW)
 cmake_policy(SET CMP0074 NEW)
 cmake_policy(SET CMP0075 NEW)
 cmake_policy(SET CMP0093 NEW)
+if(POLICY CMP0127)
+  cmake_policy(SET CMP0127 NEW)
+endif()
 
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")