Skip to content

Conversation

guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Jun 27, 2025

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.

@guitargeek guitargeek self-assigned this Jun 27, 2025
@guitargeek guitargeek requested a review from bellenot as a code owner June 27, 2025 15:55
@guitargeek guitargeek added in:Build System clean build Ask CI to do non-incremental build on PR labels Jun 27, 2025
Copy link

Test Results

    20 files      20 suites   3d 5h 31m 57s ⏱️
 3 063 tests  2 718 ✅   0 💤 345 ❌
59 670 runs  59 215 ✅ 110 💤 345 ❌

For more details on these failures, see this check.

Results for commit bb1035d.

@guitargeek guitargeek force-pushed the cmake_generator_xcode branch 2 times, most recently from 8ace470 to 0de0acc Compare August 21, 2025 19:03
@guitargeek guitargeek changed the title [CMake] Set CMAKE_OSX_SYSROOT only if CMake generator is Xcode [CMake] Set CMAKE_OSX_SYSROOT only when the host system is Apple macOS Aug 21, 2025
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.
@guitargeek guitargeek force-pushed the cmake_generator_xcode branch from 0de0acc to 046c046 Compare August 21, 2025 19:07
@pcanal
Copy link
Member

pcanal commented Aug 21, 2025

This mimics what was done in CMake before version 4.0:

if/since it is no longer done in 4.0, what was is replaced by or why do they not need it anymore (and we do)?

Copy link
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me (but see inline discussion).

@guitargeek
Copy link
Contributor Author

if/since it is no longer done in 4.0, what was is replaced by or why do they not need it anymore (and we do)?

I'm trying to understand the PR https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9977

But the more I look at at it, the less I understand why 6bd0dba was needed to begin with, because even in new CMake there is the xcrun way of determining `CMAKE_OSX_SYSROOT`` if it is not set:
https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/Platform/Darwin-Initialize.cmake?ref_type=heads#L283

Well, I don't intend to understand everything 🙂 I was only looking for the minimal changes to make ROOT compile again in nixpkgs without patches for Darwin.

@guitargeek guitargeek merged commit 3b55581 into root-project:master Aug 21, 2025
24 of 25 checks passed
@guitargeek guitargeek deleted the cmake_generator_xcode branch August 21, 2025 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clean build Ask CI to do non-incremental build on PR in:Build System
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants