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

On darwin, explicitly set CMAKE_OSX_ARCHITECTURES to avoid creating fat libraries #160

Merged
merged 1 commit into from
Oct 28, 2022
Merged

Conversation

bigfarts
Copy link
Contributor

Without explicitly CMAKE_OSX_ARCHITECTURES, when crosscompiling for x86_64 on aarch64 the libraries created are wonky and cannot be linked against.

Copy link
Member

@thomcc thomcc left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@@ -628,6 +628,16 @@ impl Config {
cmd.arg("-DCMAKE_OSX_SYSROOT=/");
cmd.arg("-DCMAKE_OSX_DEPLOYMENT_TARGET=");
}
} else if target.contains("darwin") {
if !self.defined("CMAKE_OSX_ARCHITECTURES") {
if target.contains("x86_64") {
Copy link
Member

Choose a reason for hiding this comment

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

This will be broken for x86_64h-apple-darwin if Rust ever adds it in the future (clang has this target, for example). This is a note to self as much as anything, and there's no need to handle hypothetical targets.

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