Add native macOS (Apple Silicon) support#102
Open
nelkonandparker wants to merge 1 commit into
Open
Conversation
f433a36 to
4e8fd0c
Compare
Support mac-os (apple silicon) target. Step 1 of 2 that results in a native Apple application Full disclosure - this was built with conjunction with Claude - but not pure vibe coded. I've reviewed and adjusted much of it once I broke the back of the problem. Locally I have a full working app, which will be delivered by a subsequent PR for PathOfBuilding-PoE2. ## Notable Changes (non-exhaustive) **LuaJIT:** Bumped to include arm64 mcode_alloc fixes. See: LuaJIT/LuaJIT#285 Without this, the resulting mac build had significant performance issues **Retina:** Changed the relevant cursor coordinates to support retina displays. Otherwise mouseclicks, and tooltip rendering windows were being cut off. **Clang:** Support for clang compilation, whilst maintaining MSVC ## Verification Built on OS X 26.5, and on Win. Both result in success and a working application
4e8fd0c to
f4d07fe
Compare
braggpd
pushed a commit
to braggpd/PathOfBuilding-SimpleGraphic
that referenced
this pull request
Jun 17, 2026
…JIT-fix approach Replace the custom-allocator + module-bisecting workaround stack with the upstream macOS approach from PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic PR PathOfBuildingCommunity#102, which fixes the arm64/GC64 allocation problem at the source by pinning a patched LuaJIT (port 2026-03-30_1, ref 18b087cd) rather than working around it in the engine. Removed (no longer needed once LuaJIT is fixed correctly): - mac_gc64_alloc custom allocator + magic sentinel (ui_main.cpp) - mac_pload_* / bisect / coroutine module-loading machinery (~1050 lines across ui_api.cpp and ui_main.cpp) that worked around Data.lua load failures, themselves a symptom of the same GC64 bug - sys_IMain::launchCwd and the host argv handling in sys_main.cpp - mac/entry.cpp (win/entry.cpp already compiles on macOS via its visibility macros and _WIN32 guards, matching upstream) Adopted from PR PathOfBuildingCommunity#102: - Patched LuaJIT vcpkg port (2026-03-30_1) + arm64-osx triplet + version files; baseline bumped to 2026-05-22 - AppendLocalLuaSubdir() replacing inline package.path logic - Retina/HiDPI cursor scaling + GLFW_ANGLE_PLATFORM_TYPE_METAL (sys_video.cpp) - .app bundle base-path detection (sys_main.cpp) - Portable std::this_thread::sleep_for and size_t casts (r_main/r_texture) - VirtualScreenHeight() in r_font; base64/common include + guard fixes - Lua-cURLv3 luaL_setfuncs patch + CMake patch-application; WIN32-guarded lua-utf8/luasocket; ZSTD target selection Retained (our only divergence, additive and APPLE-guarded): - pob-host launcher executable (mac/host.cpp -> "Path of Building-PoE2") that links the dylib for a runnable dev binary; upstream defers this to a separate launcher repo. The host shifts argv itself so the engine stays identical to upstream. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E69xvgJuYgUaR1eHY3Qf3o
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.
Support mac-os (apple silicon) as a target. No workflow addition (would be a follow up PR). This doesn't actually result in any mac specific libs being built, as I didn't want to pollute the workflow in this PR
I've got a 'launcher'/'application' repo (with fork specific workflows) which uses the resulting dylibs to build into a final application:
https://github.com/nelkonandparker/PathOfBuilding-PoE2-macOS
Full disclosure - this was built in conjunction with Claude - but not pure vibe coded. I've reviewed and adjusted much of it once I broke the back of the problem.
Notable Changes (non-exhaustive)
LuaJIT:
Bumped to include arm64 mcode_alloc fixes. See: LuaJIT/LuaJIT#285
Without this, the resulting mac build had significant performance issues
Retina:
Changed the relevant cursor coordinates to support retina displays. Otherwise mouseclicks, and tooltip rendering windows were being cut off.
Clang:
Support for clang compilation, whilst maintaining MSVC
Verification
Built on OS X 26.5, and on Win. Both result in success and a working application