mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
`DISTRIB_*` read os-release under `CMAKE_SYSROOT`, so cross builds got the target distro from a host-oriented command, and a process-wide static froze the first result. Add a `FROM_SYSROOT <bool>` option and policy `CMP0221` to default to the host, parse per call, and scope `CMAKE_SYSROOT` so the fallback scripts follow the same choice. Fixes: #27640
13 lines
392 B
CMake
13 lines
392 B
CMake
list(
|
|
APPEND CMAKE_GET_OS_RELEASE_FALLBACK_SCRIPTS
|
|
${CMAKE_CURRENT_SOURCE_DIR}/000-FirstFallbackScript.cmake
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Ignored-Script.cmake
|
|
${CMAKE_CURRENT_SOURCE_DIR}/999-LastFallbackScript.cmake
|
|
)
|
|
|
|
cmake_host_system_information(RESULT UFS QUERY FROM_SYSROOT ON DISTRIB_INFO)
|
|
|
|
foreach(VAR IN LISTS UFS)
|
|
message(STATUS "${VAR}=`${${VAR}}`")
|
|
endforeach()
|