Files
Daksh Mamodiya 52c8b8104b cmake_host_system_information: select host vs sysroot for DISTRIB_*
`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
2026-09-02 14:48:36 +02:00

6 lines
344 B
CMake

# CMP0221 unset (WARN): a non-DISTRIB_* query must not warn, even with a
# non-empty CMAKE_SYSROOT. Also proves the os-release is not read lazily when
# no DISTRIB_* key is requested (no stderr, no side effects).
set(CMAKE_SYSROOT "${CMAKE_CURRENT_LIST_DIR}/Sentinel")
cmake_host_system_information(RESULT cores QUERY NUMBER_OF_LOGICAL_CORES)