Copilot commented on code in PR #49993:
URL: https://github.com/apache/arrow/pull/49993#discussion_r3270627559


##########
cpp/cmake_modules/FindRapidJSONAlt.cmake:
##########
@@ -26,7 +26,10 @@ endif()
 if(RapidJSONAlt_FIND_QUIETLY)
   list(APPEND find_package_args QUIET)
 endif()
+set(_CMAKE_POLICY_VERSION_MINIMUM_OLD ${CMAKE_POLICY_VERSION_MINIMUM})
+set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
 find_package(RapidJSON ${find_package_args})
+set(CMAKE_POLICY_VERSION_MINIMUM ${_CMAKE_POLICY_VERSION_MINIMUM_OLD})

Review Comment:
   The save/restore logic doesn’t preserve the prior *defined vs undefined* 
state of `CMAKE_POLICY_VERSION_MINIMUM`. If it was previously unset, restoring 
from an empty `_CMAKE_POLICY_VERSION_MINIMUM_OLD` leaves the variable 
defined-but-empty, which can behave differently than being unset in CMake (the 
repo elsewhere uses `unset(CMAKE_POLICY_VERSION_MINIMUM)` when cleaning up). 
Track whether the variable was defined before overriding it, and 
`unset(CMAKE_POLICY_VERSION_MINIMUM)` on restore when it wasn’t previously set.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to