Skip to content

Enable native arm64 macOS build - #130

Open
pdaddyo wants to merge 3 commits into
amzeratul:developfrom
pdaddyo:feature/macos-arm64-build
Open

Enable native arm64 macOS build#130
pdaddyo wants to merge 3 commits into
amzeratul:developfrom
pdaddyo:feature/macos-arm64-build

Conversation

@pdaddyo

@pdaddyo pdaddyo commented Jun 17, 2026

Copy link
Copy Markdown

Summary

The bundled deps/osx libraries are x86_64-only and the macOS port had bit-rotted against modern Apple Clang. These changes let the engine, tools, and editor build and run natively on Apple Silicon (arm64), and document the process.

Build fixes

  • byte_serializer: add long / unsigned long operator<</>> overloads on Apple — under LP64 size_t is distinct from uint64_t (which is long long there), so serializing a size_t was otherwise unmatched
  • os_mac: parseProgramPath returns the full executable path so the caller's parentPath() resolves the asset dir correctly (was one level too high)
  • opengl: guard glObjectLabel calls — it's null on macOS OpenGL 4.1 (no KHR_debug)
  • zlib/zutil: don't define the classic-Mac fdopen stub on modern macOS, where TARGET_OS_MAC is always 1
  • avf: update MovieAPI / MoviePlayer signatures to take const HalleyAPI&, matching the current base interface
  • shader_importer_dxc: guard D3D12-only code behind _MSC_VER
  • vector_test: add typename on dependent types (required by Apple Clang)
  • cmake: link Security + CoreFoundation (needed for httplib TLS) on Apple

Docs

  • README: native Apple Silicon build instructions — Homebrew dependencies, building ShaderConductor from source (no arm64 prebuilt), and the macOS CMake configure invocation

Notes

  • A full Apple Silicon build also needs an arm64 ShaderConductor built from source (no upstream prebuilt) and Homebrew deps; both documented in the README.
  • Known issue, not addressed here: GL shader-reflection warnings ("Could not find uniform block HalleyBlock") when using a from-source ShaderConductor, whose newer SPIRV-Cross emits GLSL differently than the engine's GL reflection expects.

Opening as a draft for review.

pdaddyo added 2 commits June 17, 2026 00:56
The bundled deps/osx libraries are x86_64-only and the macOS port had
bit-rotted against modern Apple Clang. These changes let the engine,
tools, and editor build and run natively on Apple Silicon.

- byte_serializer: add long/unsigned long overloads on Apple — LP64 makes
  size_t distinct from uint64_t (which is long long there), so otherwise
  serializing a size_t is ambiguous/unmatched
- os_mac: parseProgramPath returns the full executable path so the caller's
  parentPath() lands on the right asset dir (was one level too high)
- opengl: guard glObjectLabel calls — it's null on macOS GL 4.1 (no KHR_debug)
- zlib/zutil: don't define the classic-Mac fdopen stub on modern macOS,
  where TARGET_OS_MAC is always 1
- avf: update MovieAPI/MoviePlayer signatures to take const HalleyAPI&,
  matching the current base interface
- shader_importer_dxc: guard D3D12-only code behind _MSC_VER
- vector_test: add typename on dependent types (Apple Clang requires it)
- cmake: link Security + CoreFoundation (needed for httplib TLS) on Apple
The bundled deps/osx libraries are x86_64-only, so building on Apple Silicon
uses current Homebrew dependencies plus a from-source ShaderConductor. Add a
README section covering the deps, the ShaderConductor build flags needed under
modern Apple Clang, and the CMake configure invocation.
@pdaddyo
pdaddyo marked this pull request as ready for review June 17, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant