Skip to content

Commit 3b55581

Browse files
committed
[CMake] Set CMAKE_OSX_SYSROOT only when the host system is Apple macOS
Set `CMAKE_OSX_SYSROOT` only when the host system is Apple macO, because otherwise we don't need it and the `xcrun` executable that is used to figure out this variable is not available. Like this, we avoid configuration failues when building ROOT is built for Darwin in general. This mimics what was done in CMake before version 4.0: https://gitlab.kitware.com/search?search=xcrun&nav_source=navbar&project_id=541&group_id=415&search_code=true&repository_ref=v3.31.6 Follows up on 6bd0dba and ebc38bd.
1 parent 962d075 commit 3b55581

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if(WIN32)
1212
cmake_policy(SET CMP0091 OLD)
1313
set(CMAKE_SKIP_TEST_ALL_DEPENDENCY TRUE)
1414
endif()
15-
if(APPLE AND (NOT CMAKE_OSX_SYSROOT OR CMAKE_OSX_SYSROOT STREQUAL ""))
15+
if(CMAKE_HOST_APPLE AND (NOT CMAKE_OSX_SYSROOT OR CMAKE_OSX_SYSROOT STREQUAL ""))
1616
# The SYSROOT *must* be set before the project() call
1717
execute_process(COMMAND xcrun --sdk macosx --show-sdk-path
1818
OUTPUT_VARIABLE SDK_PATH

0 commit comments

Comments
 (0)