buildsystem: fix the macOS build (Eigen 5 + Apple clang)#1801
Open
nicolassanchez02 wants to merge 2 commits into
Open
buildsystem: fix the macOS build (Eigen 5 + Apple clang)#1801nicolassanchez02 wants to merge 2 commits into
nicolassanchez02 wants to merge 2 commits into
Conversation
find_package(Eigen3 3.3 REQUIRED NO_MODULE) rejects Eigen 5, because Eigen's config-version file no longer treats a new major as compatible with an older request. Eigen 5 now ships on Arch and Homebrew, so configure aborts there before anything compiles. This is the cause of issue SFTtech#1793 and of the long-failing macOS CI on master. openage only uses the stable core and geometry API (Vector2/3/4f, Matrix4f, Affine3f, AngleAxisf, dot, prescale, UnitZ), none of which Eigen 5 drops, so dropping the version constraint is enough. A version range would be tidier but needs cmake 3.19 and our floor is 3.16. Verified by building openage and running the full test suite against a local Eigen 5.0.1: configures, compiles, and all tests pass. Closes SFTtech#1793.
f5acda8 to
5f7169b
Compare
Contributor
Author
|
Folded the macOS CI fix in here (it was #1802), so this goes green on its own instead of stopping at the Eigen change. Mac runner's passing now. |
3 tasks
The macOS workflow forced Homebrew's LLVM (`brew --prefix llvm`/clang++), which on the current runner is clang 22 whose libc++ can't find its own <math.h>/<stddef.h> ahead of the SDK's C headers, so every C++ TU fails to compile with "header search paths are not configured properly". None of the errors are in openage code. doc/building.md already recommends `--compiler=clang` (the Xcode clang) as the hassle-free macOS toolchain, so point CI at it and drop the now unused Homebrew LLVM install. Apple clang is built for the macOS SDK and its libc++, so the header-ordering problem goes away.
Contributor
Author
This was referenced May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge Checklist
make checkmergeThe macOS build is broken two ways.
find_package(Eigen3 3.3 REQUIRED NO_MODULE)atlibopenage/CMakeLists.txt:59won't take Eigen 5: the config is found, it's just refused on version (found 5.0.1, asked for 3.3), because Eigen's cmake config stopped treating a new major as satisfying an old request. Arch and Homebrew ship Eigen 5 now, so configure dies before it builds anything (that's the Arch failure in #1793). We only use the fixed-size Vector/Matrix/Affine types and none of that changed in Eigen 5, so I dropped the version bound. A range would read nicer but needs cmake 3.19 and we're on 3.16.Past that, the build still fell over compiling: the macOS job forced Homebrew's llvm, and clang 22's libc++ couldn't find its own
<math.h>before the SDK's, so nothing built. None of that was our code, it was just hidden behind the Eigen abort. building.md already says to build with--compiler=clangon macOS, so I pointed CI there and dropped the leftover llvm install.Built and tested against Eigen 5.0.1 with the system Eigen removed so only 5.x was visible: reproduced the failure, then it builds and tests clean. macOS runner's green now.
Closes #1793.