Skip to content

Commit 7ea372a

Browse files
fix: set CMAKE_POLICY_VERSION_MINIMUM for yaml-cpp Windows MSYS2 compatibility
- Set CMAKE_POLICY_VERSION_MINIMUM=3.5 to resolve CMake compatibility issue - Fixes Windows MSYS2 CLANG64/UCRT64 builds failing with 'Compatibility with CMake < 3.5 has been removed' - Verified locally: full build and YAML tests pass successfully Co-Authored-By: Jake Cosme <[email protected]>
1 parent 631fc42 commit 7ea372a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,8 @@ if(WIN32 AND (CMAKE_GENERATOR MATCHES "MSYS Makefiles" OR MSYS))
102102
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW CACHE STRING "Use NEW policy for option() behavior")
103103
endif()
104104

105-
# Add CMake policy version minimum to handle older CMake versions
106-
if(CMAKE_VERSION VERSION_LESS "3.5")
107-
cmake_policy(VERSION 3.5)
108-
endif()
105+
# Set CMake policy version minimum for yaml-cpp compatibility
106+
set(CMAKE_POLICY_VERSION_MINIMUM 3.5 CACHE STRING "Minimum CMake policy version for yaml-cpp compatibility")
109107

110108
# Disable yaml-cpp tests and tools to avoid build issues
111109
set(YAML_CPP_BUILD_TESTS OFF CACHE BOOL "Disable yaml-cpp tests")

0 commit comments

Comments
 (0)