Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support configure macOS universal2 build with ARCHFLAGS #434

Merged
merged 1 commit into from
Feb 23, 2021

Conversation

messense
Copy link
Member

@konstin
Copy link
Member

konstin commented Feb 23, 2021

Sorry, I don't fully understand what ARCHFLAGS does. Is the idea that you can somehow request a target architecture through that and do you have an example on how one would use that?

@messense
Copy link
Member Author

Sorry, I don't fully understand what ARCHFLAGS does. Is the idea that you can somehow request a target architecture through that and do you have an example on how one would use that?

That's right. You can use ARCHFLAGS to tell C/C++ compiler to build for multiple architectures. For example ARCHFLAGS="-arch x86_64 -arch arm64" instruct compiler to build for both x86_64 & arm64.

https://github.com/python/cpython/blob/a5ed2fe0eedefa1649aa93ee74a0bafc8e628a10/Lib/_osx_support.py#L260

@messense
Copy link
Member Author

Basically ARCHFLAGS make it consistent with C/C++ way of creating multiarch binary, also consistent with setuptools-rust and cibuildwheel. If rustc/cargo can produce universal macos binary in the future, I think they might want to use it too to play nice with C dependencies.

@konstin
Copy link
Member

konstin commented Feb 23, 2021

Ah, that's cool!

@konstin konstin merged commit 1b6ca96 into PyO3:master Feb 23, 2021
@messense messense deleted the universal2-archflags branch February 23, 2021 16:03
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