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

APPLE: iOS Build script minimal #2035

Conversation

slingthor
Copy link
Contributor

@slingthor slingthor commented Sep 9, 2022

Description of Change(s)

The most minimal set of build script changes required to build iOS on top of earlier cross platform building PR.
See creijon#1
to visualise the change against cross compile

We pull the dependency ios.toolchain.cmake from https://github.com/leetal/ios-cmake/releases/tag/4.3.0 and treat it as a package dependency if we are building in iOS

  • I have submitted a signed Contributor License Agreement

@slingthor slingthor force-pushed the thor/dev/ios_building_minimal branch 3 times, most recently from 644a73f to 81ea784 Compare September 10, 2022 16:07
@slingthor
Copy link
Contributor Author

Made a small improvement to this

@slingthor
Copy link
Contributor Author

Noting as well, building with python is not supported on iOS as is - wondering if we should make that explicit and automatically turn python building off if iOS?

@slingthor slingthor mentioned this pull request Sep 10, 2022
1 task
@meshula
Copy link
Member

meshula commented Sep 10, 2022

Following a rule of least surprise, I'd say the most surprising thing to someone building for iOS would be that Python was necessary to the run time. The least surprising thing would be that building for iOS, with Python, has to be explicitly enabled, and involves further challenges. So it makes eminent sense to me that iOS should default python building off.

@drwave
Copy link

drwave commented Sep 11, 2022 via email

@slingthor slingthor force-pushed the thor/dev/ios_building_minimal branch from 81ea784 to e26ee6e Compare September 12, 2022 16:34
@tallytalwar
Copy link
Contributor

Filed as internal issue #USD-7633

@SimonBenAnderson
Copy link

Hi, I do apologies as this is the wrong place to ask this, but I have been trying to build this branch with no success and was wondering if someone would be so kind and help recommend what I might be doing wrong.

I have pulled this branch and run the following
python3 ./build_scripts/build_usd.py --generator Xcode --no-python --build-target ios ./USDInstall

once all the dependencies have been pulled and it starts building, I get a large amount of note prints

note: Run script build phase 'Generate pxr/base/gf/CMakeFiles/gf_headerfiles' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'gf_headerfiles' from project 'usd')

Run script build phase 'CMake PostBuild Rules' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'usdUI' from project 'usd')

Those are just a few.

Is there a way to build this branch so that in XCode you have the ability to Switch targets from OSX to iOS? as I would like to use this in a Swift App I am currently writing.

@meshula
Copy link
Member

meshula commented Oct 31, 2022

@SimonBenAnderson I would love to know if there is newer information about having macOS and iOS targets in the same project generated from cmake, but according to this older issue, it's not possible, due to cmake's design -

https://gitlab.kitware.com/cmake/cmake/-/issues/17805

I think the a method you could use today would be to build the USD libraries separately for macOS and iOS, and link those separately compiled libraries to your project. You'd have to make two build directories, and configure cmake separately, one directory for mac, and one for iOS, rather than trying to do both builds in the same directory.

@slingthor
Copy link
Contributor Author

slingthor commented Oct 31, 2022 via email

@SimonBenAnderson
Copy link

Thank you for the reply @meshula and @slingthor. I am currently building on an M1, OSXv13.0, Xcode 14.0.1. What version are you building with? at least I know I am using the correct command to build the ios version 😄

@slingthor
Copy link
Contributor Author

slingthor commented Oct 31, 2022 via email

@SimonBenAnderson
Copy link

@slingthor Thank you for the info, it build 100% 🍻

@slingthor
Copy link
Contributor Author

Cool :D Glad to know! We don't have a USDView on iOS yet, but if you have something to display a surface you should be good!

@drwave
Copy link

drwave commented Nov 1, 2022 via email

@SimonBenAnderson
Copy link

@slingthor at the moment if I can query the data/create files/ object instances then I am happy, as I am currently writing my own renderer for iOS, and wanted to leverage USD. Thanks @drwave I shall take a look at that code.

Just wanted to say a huge thank you once again, for all the help

@slingthor slingthor closed this Nov 29, 2022
@slingthor slingthor mentioned this pull request Feb 9, 2023
AdamFelt pushed a commit to autodesk-forks/USD that referenced this pull request Apr 16, 2024
AdamFelt pushed a commit to autodesk-forks/USD that referenced this pull request Apr 16, 2024
AdamFelt pushed a commit to autodesk-forks/USD that referenced this pull request Apr 16, 2024
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.

5 participants