macOS: skip Libunwind on Apple + fix DevIL include-dir lookup#3041
Open
tomjn wants to merge 1 commit into
Open
macOS: skip Libunwind on Apple + fix DevIL include-dir lookup#3041tomjn wants to merge 1 commit into
tomjn wants to merge 1 commit into
Conversation
5aba184 to
60526b5
Compare
Collaborator
|
How did devil work before? |
Configure/link fixes needed to build on macOS: - Skip Libunwind on Apple, in both places it is referenced: rts/CMakeLists.txt (the find_package + engineCommonLibraries link) and rts/builds/dedicated/CMakeLists.txt (the engine-dedicated link list). find_package(Libunwind REQUIRED) targets the LLVM/nongnu libunwind used on Linux/BSD; macOS provides its own unwinding and the package isn't present, so configure failed and engine-dedicated linked a missing libunwind::libunwind target. Guard both with NOT APPLE (OpenBSD was already excluded). - FindDevIL: search for IL/il.h instead of bare il.h, so IL_INCLUDE_DIR is the directory that makes the code's #include <IL/il.h> resolve. Searching for il.h returned the IL/ subdirectory itself on layouts like Homebrew's <prefix>/include/IL, so <IL/il.h> did not resolve and configure failed on macOS. This matches how IL_INCLUDE_DIR is already used elsewhere (e.g. tools/scripts/prepare_static_spring.sh passes the parent include dir). On Linux the system include path masked the old behavior. No effect on the Linux/Windows build paths. Assisted by Claude Code; verified by configuring on macOS.
Contributor
Author
|
@sprunk updated the PR, the cmake find IL macro would set the include prefix wrong on MacOS to the IL folder so it'd need changing to |
60526b5 to
1f4225d
Compare
sprunk
approved these changes
Jun 22, 2026
sprunk
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, would be nice to verify this doesn't break some other setup though.
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.
What
Configure/link fixes for building on macOS.
1. Skip Libunwind on Apple — in both places it's referenced (
rts/CMakeLists.txtfind+link, andrts/builds/dedicated/CMakeLists.txtlink list).find_package(Libunwind REQUIRED)targets the LLVM/nongnu libunwind used on Linux/BSD; macOS has its own unwinding and the package isn't present. Both guards getNOT APPLE(OpenBSD was already excluded).2. Fix
FindDevILat the root (reworked per review — answering "how did devil work before?")The module searched for bare
il.hand setIL_INCLUDE_DIRto the directory containing it. The code does#include <IL/il.h>, which needs the parent. On Homebrew (<prefix>/include/IL/il.h) that landed on<prefix>/include/IL, so<IL/il.h>didn't resolve. On Linux the system include path (/usr/include) masked this, which is why it "worked before".Searching for
IL/il.hmakesIL_INCLUDE_DIRthe parent on every platform — which also matches how it's already consumed elsewhere (tools/scripts/prepare_static_spring.shpasses the parent include dir asIL_INCLUDE_DIR). This replaces the earlier downstream workaround inrts/CMakeLists.txtwith a root-cause fix in the Find module.Verified:
Found DevIL: /opt/homebrew/lib/libIL.dyliband<IL/il.h>resolves on macOS;find_path(IL/il.h)returns/opt/homebrew/includevs the old/opt/homebrew/include/IL.Safety
Configure/link-only. libunwind guards add
NOT APPLE(Linux/BSD unchanged). The FindDevIL change returns the parent dir on all platforms, matching existingIL_INCLUDE_DIRusage.Surfaced building
unitsync/spring-dedicatedon macOS with Homebrew GCC.Assisted by Claude Code; verified by configuring on macOS.