Conversation
Added gmake-osx-x64 project generation and build targets alongside existing osx-arm64, enabling universal binary creation via lipo.
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. |
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.
Title
Added macOS x86_64 build target (osx-x64).
Body
Problem
The bgfx makefile only provides
osx-arm64gmake 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
projgenand build sections were only populated with ARM64 macOS targets.Fix
Add
gmake-osx-x64project generation and debug/release build targets, mirroring the existingosx-arm64structure.projgen: add$(GENIE) --gcc=osx-x64 gmakeosx-x64-debug,osx-x64-release,osx-x64Test
make projgenon macOS and verify.build/projects/gmake-osx-x64is generated.make osx-x64and verify both debug and release configurations compile successfully on an Intel Mac (or via Rosetta).lipo -createto mergeosx-arm64andosx-x64outputs into a universal binary.