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

Add visionOS support #1029

Merged
merged 5 commits into from
Apr 12, 2024
Merged

Add visionOS support #1029

merged 5 commits into from
Apr 12, 2024

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Apr 10, 2024

I haven't added this to CI, as the Rust builds themselves are still somewhat broken until rust-lang/libc#3568 lands.

CC @BlackHoleFox

src/lib.rs Outdated Show resolved Hide resolved
@QuentinPerez
Copy link

We were definitely working on the same thing; I made almost the same changes. The only differences are the XROS_DEPLOYMENT_TARGET and this additional check on lines 2658 and 2674

                // there is no -m{}os-version-min for watchos, tvos, visionos
                if matches!(os, AppleOs::Ios | AppleOs::MacOs) {
                    cmd.args.push(
                        format!("-m{}os-version-min={}", sdk_details.sdk_prefix, min_version)
                            .into(),
                    );
                }

@madsmtm
Copy link
Contributor Author

madsmtm commented Apr 10, 2024

there is no -m{}os-version-min for watchos, tvos, visionos

There is, see Clang's docs for the availability attribute and Clang's docs for e.g. the -mtvos-version-min flag itself.

However, you right that it does not exist for visionOS, I've opened llvm/llvm-project#88271 for that. This is somewhat problematic, as we need to tell Clang about the desired deployment target. Perhaps we can set XROS_DEPLOYMENT_TARGET? Or maybe -mtargetos=xros1.0?

@madsmtm
Copy link
Contributor Author

madsmtm commented Apr 11, 2024

Using just --target is recommended by Clang Driver developers, which we already do, so I think that is a non-issue.

Have opened #1030 to track removing the other flags from Apple targets.

Copy link
Contributor

@BlackHoleFox BlackHoleFox left a comment

Choose a reason for hiding this comment

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

Nice :D

@NobodyXu NobodyXu merged commit e80a19d into rust-lang:main Apr 12, 2024
23 checks passed
@NobodyXu
Copy link
Collaborator

Thank you!

@madsmtm madsmtm deleted the visionos branch April 12, 2024 10:25
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.

None yet

4 participants