Skip to content

Added macOS x86_64 build target (osx-x64). - #3686

Open
labolado wants to merge 1 commit into
bkaradzic:masterfrom
labolado:pr/macos-x64-build
Open

labolado wants to merge 1 commit into
bkaradzic:masterfrom
labolado:pr/macos-x64-build

Conversation

@labolado

Copy link
Copy Markdown

Title

Added macOS x86_64 build target (osx-x64).

Body

Problem

The bgfx makefile only provides osx-arm64 gmake targets. There is no gmake target for building x86_64 binaries on macOS, which is needed for creating universal binaries (lipo-merged fat binaries) that support both Intel and Apple Silicon Macs.

Root cause

The makefile's projgen and build sections were only populated with ARM64 macOS targets.

Fix

Add gmake-osx-x64 project generation and debug/release build targets, mirroring the existing osx-arm64 structure.

  • projgen: add $(GENIE) --gcc=osx-x64 gmake
  • Build targets: osx-x64-debug, osx-x64-release, osx-x64

Test

  • Run make projgen on macOS and verify .build/projects/gmake-osx-x64 is generated.
  • Run make osx-x64 and verify both debug and release configurations compile successfully on an Intel Mac (or via Rosetta).
  • Use lipo -create to merge osx-arm64 and osx-x64 outputs into a universal binary.

Added gmake-osx-x64 project generation and build targets alongside
existing osx-arm64, enabling universal binary creation via lipo.
@labolado
labolado requested a review from bkaradzic as a code owner April 24, 2026 16:50
@mcourteaux

Copy link
Copy Markdown
Contributor

I think the reason this is not the case in the project as is, is because advanced users should manually invoke GENie either way. Relying on the makefile with a random set of project parameters is not a good idea either way.

If you're looking to build fully cross platform, I recommend the zig compiler toolchain. It's quite a bit of work to get it to compile bgfx and all it's dependencies, but once you're there, it's actually great. Pro tip in that case: don't compile shaderc through zig, just make that a native build and invoke it from zig.

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.

2 participants