CMakeDetermineSystem: Do not try to lookup 'uname' in CMAKE_SYSROOT

We find `uname` before the toolchain file has been included, so the user
has not yet been able to set `CMAKE_FIND_ROOT_PATH_MODE_PROGRAM`.  If
`CMAKE_SYSROOT` is passed via the command line, avoid searching in it.
This commit is contained in:
Dmitry Vilkov
2026-06-30 12:02:02 -04:00
committed by Brad King
parent 19d5579d67
commit 15ddce7e35
+1 -1
View File
@@ -9,7 +9,7 @@
# find out on which system cmake runs
if(CMAKE_HOST_UNIX)
find_program(CMAKE_UNAME NAMES uname PATHS /bin /usr/bin /usr/local/bin)
find_program(CMAKE_UNAME NAMES uname PATHS /bin /usr/bin /usr/local/bin NO_CMAKE_FIND_ROOT_PATH)
if(CMAKE_UNAME)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "AIX")
execute_process(COMMAND ${CMAKE_UNAME} -v