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

Fix min target flag for xros and xros-simulator #14776

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

NoWiseMan
Copy link
Contributor

@NoWiseMan NoWiseMan commented Sep 19, 2023

Changelog: Fix: Fix min target flag for xros and xros-simulator.
Docs: omit

Apple changes the way the "min target os version" flag is created
see: https://developer.apple.com/forums/thread/737595

This fixes the generation of the min target version flag for visionsOS and visionsOS simulator

@memsharded
Copy link
Member

These lines were added by @stevn in #14504, it would be great to get their feedback.

Also, this functionality is clearly not covered by tests if we can change it and it doesn't break anything, it would be good to add some tests that validate this, or at least do some checking.

@NoWiseMan
Copy link
Contributor Author

FYI:
The current CMake nightly build has a similar "bug"

@memsharded memsharded added this to the 2.0.12 milestone Sep 21, 2023
@memsharded
Copy link
Member

Any feedback wrt this change @stevn?
Do you think that you could try to add some tests to cover this change @NoWiseMan? If not sure, please ask for help, or we can try to contribute a test ourselves.

Thanks to both!

@NoWiseMan
Copy link
Contributor Author

Besides conan I did not any python development.
I can try to implement a test, but I first need to understand how to run them locally

@memsharded
Copy link
Member

Don't worry @NoWiseMan if you don't have much experience with Python, we can contribute the tests, no need to do a very large effort, thanks!

@NoWiseMan
Copy link
Contributor Author

I'm not sure if there is any support for visionOS in the Intel-based simulator.
If yes this PR need more work.

Co-authored-by: Francisco Ramírez <franchuti688@gmail.com>
@NoWiseMan
Copy link
Contributor Author

There is an intel-based simulator.

So the flag -target arm64-apple-xros{os_version} is only correct for arm
the intel version needs -target x86_64-apple-xros{os_version}
d
for that def apple_min_version_flag(os_version, os_sdk, subsystem): needs an additional archparameter

@czoido czoido modified the milestones: 2.0.12, 2.0.13, 2.0.14 Sep 26, 2023
@memsharded
Copy link
Member

Hi @NoWiseMan

@stevn hasn't given any feedback regarding this change, and we are also overwhelmed, so difficult to test this too on our side.
If this change is working for you @NoWiseMan, I am happy to merge it as-is. If you could please explicitly comment on the different versions (cmake, OSX, sdk, etc) that are needed for this to work, that could be enough, and I could merge this for next 2.0.14. Thanks again!

@stevn
Copy link
Contributor

stevn commented Oct 26, 2023

Hi,
yeah sorry for going quiet - I meant to look into this but currently can't find the time. Thanks

@memsharded
Copy link
Member

yeah sorry for going quiet - I meant to look into this but currently can't find the time. Thanks

No prob! Thanks for following up 🙂

@NoWiseMan
Copy link
Contributor Author

Yes for me this is working.
Luckily with Xcode 15.1 Beta Apple has removed the x86_64 target
-target x86_64-apple-xros1.0
and we no longer need the arch parameter I mentioned earlier and the PR is perfectly fine yet.

But there is still a unfixed issue in cmake 3.28rc2.
It is not possible to build cmake based libs with conan and cmake for visionOS simulator without patching

Apple-Clang.cmake

....
  elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/XRSimulator")
    set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "")
....

and replacing the flag with an empty string

@memsharded
Copy link
Member

Ok, so the PR seems good, and the patch that is still missing seems something on the CMake side, not something that Conan should fix, but if you think it would be easy to add something to the CMakeToolchain that automatically adds set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "") conditioned on the VisionOS and that could work, that could be added, feel free to open another PR if you'd like.

I am merging this, thanks very much!

@memsharded memsharded merged commit 79e6d7d into conan-io:release/2.0 Oct 26, 2023
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.

5 participants