Skip to content

macOS: allow CMAKE_OSX_ARCHITECTURES to be arm64#1750

Merged
eXpl0it3r merged 1 commit intoSFML:masterfrom
ZivixLLC:issue-1749
Mar 6, 2021
Merged

macOS: allow CMAKE_OSX_ARCHITECTURES to be arm64#1750
eXpl0it3r merged 1 commit intoSFML:masterfrom
ZivixLLC:issue-1749

Conversation

@jkeller51
Copy link
Copy Markdown
Contributor

  • Has this change been discussed on the forum or in an issue before?
  • Does the code follow the SFML Code Style Guide?
  • Have you provided some example/test code for your changes?
  • If you have additional steps which need to be performed list them as tasks!

Description

Changed CMakeLists.txt to allow CMAKE_OSX_ARCHITECTURES to be either x86_64, arm64, or both. This allows native builds on apple silicon.

This PR is related to the issue #1749

Tasks

  • Tested on macOS

How to test this PR?

Pull the code on MacOS, enter some value into CMAKE_OSX_ARCHITECTURES , and configure.

@MarioLiebisch
Copy link
Copy Markdown
Member

I'm not really sure, I'd say it's better to just drop the whole check, since you could also compile/build both architectures into the same file (although I haven't tried that yet with SFML).

@jkeller51
Copy link
Copy Markdown
Contributor Author

Actually, this will allow that as well. I've been distributing my MacOS app as a "universal app" which contains both architectures into a single binary (all static/dynamic libs also build into a single binary containing two architectures).

Copy link
Copy Markdown
Member

@eXpl0it3r eXpl0it3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on our brand new Mac Mini M1 🎉

@eXpl0it3r eXpl0it3r merged commit 252d26a into SFML:master Mar 6, 2021
ryandesign referenced this pull request in macports/macports-ports Mar 9, 2021
Add a patch to remove the check for x86_64 architecture in
CMakeLists.txt allowing the package to build for arm64.

Closes: https://trac.macports.org/ticket/62334

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
@jkeller51 jkeller51 deleted the issue-1749 branch March 19, 2021 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants