Skip to content

M3b: wire ObjC++ (.mm) Metal compilation into build.rs (Apple targets) #6

Description

@Bantarus

Context

The native libs are built Vulkan-only today (build.rs passes --with_vulkan; no Metal). Metal requires ObjC++ (.mm) compilation, not plain clang: rive's premake swaps specific .cpp -> .mm under Apple filters and compiles src/metal/*.mm (premake5_pls_renderer.lua:343-345); ore_context.hpp imports <Metal/Metal.h>. This is the largest single build-system delta of any backend and gates all Metal work. Sequenced AFTER the Metal spike.

Scope

  • Teach build.rs to compile rive's Metal sources as ObjC++ on macOS/iOS targets (premake handles the .cpp->.mm swap under its Apple filters; ensure the shim TU and any bootstrap equivalents compile as ObjC++ where needed).
  • Add the Metal-equivalent of --with_vulkan to the premake invocation and link Metal/Foundation/QuartzCore frameworks.
  • Keep the Linux/Windows builds unchanged (Metal path Apple-only).

Acceptance criteria

  • A from-source build on macOS produces the rive Metal libs + an ObjC++-compiled shim and links cleanly.
  • Vulkan (Linux) and D3D12 (Windows) builds are unaffected.

Refs

  • crates/rive-renderer-sys/build.rs:244-419
  • vendor/rive-runtime/renderer/premake5_pls_renderer.lua:343-345 (src/metal/*.mm Apple filter)
  • vendor/rive-runtime/renderer/src/metal/render_context_metal_impl.mm

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions