Skip to content

Support XCFramework builds, Catalyst#18826

Merged
alalek merged 86 commits intoopencv:masterfrom
Rightpoint:feature/colejd/build-catalyst-xcframework
Nov 24, 2020
Merged

Support XCFramework builds, Catalyst#18826
alalek merged 86 commits intoopencv:masterfrom
Rightpoint:feature/colejd/build-catalyst-xcframework

Conversation

@colejd
Copy link
Copy Markdown
Contributor

@colejd colejd commented Nov 16, 2020

Hello!

For this PR, @chrisballinger and I have added support for building OpenCV into an xcframework, enabling support on a variety of Apple devices with one build command. As part of this, we also introduced support for generating Catalyst-compatible frameworks through platforms/osx/build_framework.py. As a side effect, this makes it easier to build for Apple Silicon / M1.

By default, the generated xcframework supports the following platforms and architectures:

  • iOS (--iphoneos_archs): arm64, armv7
  • iOS Simulator (--iphonesimulator_archs): x86_64, arm64
  • MacOS (--macos_archs): x86_64, arm64
  • Mac Catalyst (--catalyst_archs): x86_64, arm64

Additionally, you can now use a new --build_only_specified_archs flag on the iOS and OSX build scripts to build only directly specified archs. This prevents the scripts from falling back to a default set of architectures if none are specified. We leverage this to generate platform-specific frameworks that we later combine into an xcframework.

This resolves #17929, and relates to #17291.

Testing

You can generate the framework by going into platforms/apple and running python3 ./build_xcframework.py ./xcframework-build. The script requires that you have CMake 3.18.5+, Python 3.6+, MacOS 10.15+, and Xcode 12.2+, which are enforced by the build script.

Caveats

  • CMake 3.18.5/3.19 or greater is required to build non-x86_64 iOS Simulator frameworks with CMake (discussion here), so we require this as a minimum version.

  • Support for the objc module on Catalyst is currently disabled, as there are currently incompatibilities with CMake (discussion here). We plan to follow up with a PR to re-enable this support when possible. The situation here has updated. See here for more info.

  • The new --catalyst_archs flag on the osx build script does not have any defaults, though every other archs-setting flag does. Since the scripts select a default set of architectures if none are specified directly, we need to default to None for Catalyst to avoid breaking any existing CI. When it's possible to make a breaking change, it'd be nice to have the behavior match the other archs-setting flags.

Future Work

  • We plan to put in a PR for hooking into OpenCV's CI infrastructure to build/upload the generated xcframework, though we need some guidance on this.

  • We'd like to put in another PR that adds Swift Package Manager support using the binary xcframework as soon as it's available in a future tagged release of OpenCV. This would let users add OpenCV to their projects through Xcode very easily. (Update: We're working on this at Swift Package Manager [WIP] Rightpoint/opencv#4)

  • We'd also like to put in a PR to move the ios and osx build scripts and supporting files into the new apple platform directory, though this would be a breaking change for CI. We could do this now by moving the scripts and providing aliases.

Pull Request Readiness Checklist

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake
force_builders_only=docs,ios,Custom Mac
build_image:Custom Mac=osx_framework-test
buildworker:Custom Mac=macosx-2

Comment on lines +36 to +45

if target == "Catalyst":
buildcmd.append("-destination 'platform=macOS,arch=%s,variant=Mac Catalyst'" % arch)
buildcmd.append("-UseModernBuildSystem=YES")
buildcmd.append("SKIP_INSTALL=NO")
buildcmd.append("BUILD_LIBRARY_FOR_DISTRIBUTION=YES")
buildcmd.append("TARGETED_DEVICE_FAMILY=\"1,2\"")
buildcmd.append("SDKROOT=iphoneos")
buildcmd.append("SUPPORTS_MAC_CATALYST=YES")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Depending on the results of https://gitlab.kitware.com/cmake/cmake/-/issues/21436 this whole block might not be necessary. If it is, we could still probably trim this down to a more minimal set of overrides because I think some of these are already handled elsewhere in the toolchain.

Comment on lines +233 to +252
if target.lower().startswith("iphonesimulator"):
build_arch = check_output(["uname", "-m"]).decode('utf-8').rstrip()
if build_arch != arch:
print("build_arch (%s) != arch (%s)" % (build_arch, arch))
cmakecmd.append("-DCMAKE_SYSTEM_PROCESSOR=" + arch)
cmakecmd.append("-DCMAKE_OSX_ARCHITECTURES=" + arch)
cmakecmd.append("-DCPU_BASELINE=DETECT")
cmakecmd.append("-DCMAKE_CROSSCOMPILING=ON")
cmakecmd.append("-DOPENCV_WORKAROUND_CMAKE_20989=ON")
if target.lower() == "catalyst":
build_arch = check_output(["uname", "-m"]).decode('utf-8').rstrip()
if build_arch != arch:
print("build_arch (%s) != arch (%s)" % (build_arch, arch))
cmakecmd.append("-DCMAKE_SYSTEM_PROCESSOR=" + arch)
cmakecmd.append("-DCMAKE_OSX_ARCHITECTURES=" + arch)
cmakecmd.append("-DCPU_BASELINE=DETECT")
cmakecmd.append("-DCMAKE_CROSSCOMPILING=ON")
cmakecmd.append("-DOPENCV_WORKAROUND_CMAKE_20989=ON")
if target.lower() == "macosx":
build_arch = check_output(["uname", "-m"]).rstrip()
build_arch = check_output(["uname", "-m"]).decode('utf-8').rstrip()
if build_arch != arch:
print("build_arch (%s) != arch (%s)" % (build_arch, arch))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we ever determined if these were strictly necessary for these other platforms but, if they are, we might want to consider consolidating the additional arguments into a single block since they are shared among these 3 platforms.

@colejd colejd force-pushed the feature/colejd/build-catalyst-xcframework branch 2 times, most recently from 283cdfe to 36c6f85 Compare November 17, 2020 21:54
@alalek
Copy link
Copy Markdown
Member

alalek commented Nov 18, 2020

/cc @komakai

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

Thank you for contribution!

@chrisballinger
Copy link
Copy Markdown
Contributor

chrisballinger commented Nov 18, 2020

@alalek We would like the xcframework build artifact eventually available as GitHub release assets (as seen here), as it's a pre-requisite for Swift Package Manager support. From an initial investigation it seems that we would want to submit a pull request to the opencv-infrastructure/opencv-master-config repo with some changes here:

Is there anything else that we'd need to modify to help support the process for GitHub release assets? Thanks!

@alalek
Copy link
Copy Markdown
Member

alalek commented Nov 19, 2020

@chrisballinger
There are some efforts to move out build details from this Buildbot configuration (it is hard enough to test any changes, because testing requires properly configured Buildbot instance for that).
Modern build configurations are shell-based (no buildbot dependency), but local invocations requires some pre-work (which is not well documented). Simple example.

Not sure that we should request to prepare patches in these scripts from you.
Usually it is enough to have:

  • command like python3 ./build_xcframework.py
  • how to package artifacts (preferable if it is done by "build_*.py" scripts automatically or through --flag) and which to publish
  • list of prerequisites (platforms/apple/readme.md) (Xcode 12 is current show stopper in public CI infra)

As alternative, it would be nice to setup Travis.org / "GitHub Actions" for that (or similar service with OSX support, like )

  • need to ensure that packaging process fits in timeout limits of the service (its community "free" plan)
  • initial work can be started in your fork with configured service (for your fork)
  • moving of artifacts is acceptable as a manual step (no need to script that part), but we need to know where to grab them.
  • community can be involved in supporting of this configuration and its future upgrades

@chrisballinger
Copy link
Copy Markdown
Contributor

@alalek Ah interesting! From some initial research, it seems that GitHub Actions has a 6 hour job limit and 2 GB org-wide artifact limit and already supports Xcode 12.2 which is required for this PR's Apple Silicon support. Building the 10 architecture/platform combinations takes about 2-3 hours on my 2018 15" MBP, so it would probably be okay. We could also probably drop support for armv7s iOS (retaining armv7) and i386 simulator to speed things up a little and save some space.

We will also probably want to create two CI jobs - one to create a static xcframework and one for a dynamic xcframework. It looks like there is a bug in Xcode/SPM that prevents the static xcframework from working properly (it tries to copy the framework into the app bundle and code sign it, which is invalid behavior for a static framework so it fails). So for SPM users we will need to provide a dynamic xcframework until that bug is fixed. I think that CocoaPods does properly support static xcframeworks so I am going to investigate that route as a workaround.

@alalek
Copy link
Copy Markdown
Member

alalek commented Nov 20, 2020

Please take a look on "Custom Mac" builder error (OSX framework + tests):

/Volumes/build-storage/build/precommit_custom_mac/build/osx/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/test/test/Calib3dTest.swift:8:8: error: no such module 'opencv2'
import opencv2
       ^


Test session results, code coverage, and logs:
	/Users/build/Library/Developer/Xcode/DerivedData/OpenCVTest-eqjyunzjyjdofeaifbcvjaweldfh/Logs/Test/Test-OpenCVTestTests-2020.11.18_22-34-56-+0000.xcresult

Testing failed:
	OpenCVTestTests:
		No such module 'opencv2'
	Testing cancelled because the build failed.

** TEST FAILED **

@komakai
Copy link
Copy Markdown
Contributor

komakai commented Nov 20, 2020

Testing failed:
OpenCVTestTests:
No such module 'opencv2'
Testing cancelled because the build failed.

@alalek This looks like the error we were getting with Xcode 10.2.1 - have you upgraded the environment yet?

@alalek
Copy link
Copy Markdown
Member

alalek commented Nov 20, 2020

This error message is from buildworker with AppleClang 11.0.0.11000033 (Xcode 11, macosx-2 buildworker)
Also there is worker with AppleClang 10.0.1.10010046 (Xcode 10, macosx-1 buildworker - planned for upgrade to Xcode 12 in 1-2 weeks)

@tianye2856
Copy link
Copy Markdown

@colejd @chrisballinger
Got some error in the final xcframework step
Could you please help us and the error is here

Creating universal library from:
	/Users/danieltian/Desktop/Code/github/tmp/build/build-x86_64-macosx/lib/Release/libopencv_merged.a
	/Users/danieltian/Desktop/Code/github/tmp/build/build-arm64-macosx/lib/Release/libopencv_merged.a
Executing: ['lipo', '-create', '/Users/danieltian/Desktop/Code/github/tmp/build/build-x86_64-macosx/lib/Release/libopencv_merged.a', '/Users/danieltian/Desktop/Code/github/tmp/build/build-arm64-macosx/lib/Release/libopencv_merged.a', '-o', '/Users/danieltian/Desktop/Code/github/tmp/opencv2.framework/Versions/A/opencv2'] in None
Executing: lipo -create /Users/danieltian/Desktop/Code/github/tmp/build/build-x86_64-macosx/lib/Release/libopencv_merged.a /Users/danieltian/Desktop/Code/github/tmp/build/build-arm64-macosx/lib/Release/libopencv_merged.a -o /Users/danieltian/Desktop/Code/github/tmp/opencv2.framework/Versions/A/opencv2
To run tests call:
/Users/danieltian/Desktop/Code/github/opencv/platforms/osx/run_tests.py --framework_dir=/Users/danieltian/Desktop/Code/github/tmp --framework_name=opencv2 /Users/danieltian/Desktop/Code/github/tmp/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/test
To build docs call:
/Users/danieltian/Desktop/Code/github/opencv/platforms/osx/build_docs.py /Users/danieltian/Desktop/Code/github/tmp/build/build-x86_64-macosx/modules/objc/framework_build
Executing: ['xcodebuild', '-create-xcframework', '-output', 'out/opencv2.xcframework', '-framework', './out/ios/opencv2.framework', '-framework', './out/ios-simulator/opencv2.framework', '-framework', './out/ios-maccatalyst/opencv2.framework', '-framework', './out/macos/opencv2.framework'] in /Users/danieltian/Desktop/Code/github
Executing: xcodebuild -create-xcframework -output out/opencv2.xcframework -framework ./out/ios/opencv2.framework -framework ./out/ios-simulator/opencv2.framework -framework ./out/ios-maccatalyst/opencv2.framework -framework ./out/macos/opencv2.framework
error: the path does not point to a valid framework: /Users/danieltian/Desktop/Code/github/out/ios/opencv2.framework
============================================================
ERROR: Command '['xcodebuild', '-create-xcframework', '-output', 'out/opencv2.xcframework', '-framework', './out/ios/opencv2.framework', '-framework', './out/ios-simulator/opencv2.framework', '-framework', './out/ios-maccatalyst/opencv2.framework', '-framework', './out/macos/opencv2.framework']' returned non-zero exit status 70.
============================================================
Traceback (most recent call last):
  File "opencv/platforms/apple/build_xcframework.py", line 99, in <module>
    execute(xcframework_build_command, cwd=os.getcwd())
  File "/Users/danieltian/Desktop/Code/github/opencv/platforms/apple/cv_build_utils.py", line 13, in execute
    retcode = check_call(cmd, cwd = cwd)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['xcodebuild', '-create-xcframework', '-output', 'out/opencv2.xcframework', '-framework', './out/ios/opencv2.framework', '-framework', './out/ios-simulator/opencv2.framework', '-framework', './out/ios-maccatalyst/opencv2.framework', '-framework', './out/macos/opencv2.framework']' returned non-zero exit status 70.

@tianye2856
Copy link
Copy Markdown

@colejd After fixing the framework alias problem for opencv binary(create alias for every framework header and binary, put them in the framework directory), I still get some error.
It seams that the error has some relation with Apple code sign system.

danieltian in ~/Desktop/Code/github/opencv/platforms/apple on branch feature/colejd/build-catalyst-xcframework > xcodebuild -create-xcframework  -framework ./xcframework-build/ios/opencv2.framework -framework ./xcframework-build/ios-simulator/opencv2.framework -framework ./xcframework-build/ios-maccatalyst/opencv2.framework -framework ./xcframework-build/macos/opencv2.framework -output ./xcframework-build/opencv2.xcframework
error: unable to create a Mach-O from the binary at '/Users/danieltian/Desktop/Code/github/opencv/platforms/apple/xcframework-build/ios/opencv2.framework/opencv2'
danieltian in ~/Desktop/Code/github/opencv/platforms/apple on branch feature/colejd/build-catalyst-xcframework > 

@chrisballinger
Copy link
Copy Markdown
Contributor

@alalek @komakai This PR was designed to be built with Xcode 12.2 or higher for xcframework support, but we tried to ensure that the existing use cases would be backwards compatible. There are some additional fixes from my WIP SPM PR that we'll cherry-pick into this PR, which will probably resolve the issues people have noticed so far.

@tianye2856 Please try out my SPM PR, it also allows building with --dynamic which fixes an issue where Xcode tries to code sign the static framework.

@colejd
Copy link
Copy Markdown
Contributor Author

colejd commented Nov 23, 2020

Now that this PR is passing tests and is feature-complete by our standards, I would say this is ready for another round of review. @alalek

@chrisballinger
Copy link
Copy Markdown
Contributor

@alalek @komakai Since the initial PR, we've added/fixed the following:

  • Support for building both dynamic and static xcframeworks for all supported platforms (iphoneos, macos, iphonesimulator, maccatalyst). Dynamic xcframeworks are required for Swift Package Manager integration to work properly.
  • Re-enabled building most of the objc module for Mac Catalyst targets. The Swift convenience wrappers had to be excluded for that target because CMake does not support building Swift files for Catalyst targets.

We are starting our iteration on GitHub Actions support this week, but will keep that work isolated in another branch to keep this branch stable for review.

@alalek
Copy link
Copy Markdown
Member

alalek commented Nov 24, 2020

@colejd Could you please apply (cherry-pick) commit with minor coding style changes from here: https://github.com/alalek/opencv/commits/pr18826_r

@chrisballinger
Copy link
Copy Markdown
Contributor

@alalek Done!

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@alalek alalek merged commit 85b0fb2 into opencv:master Nov 24, 2020
This was referenced Nov 27, 2020
@vade
Copy link
Copy Markdown

vade commented Dec 10, 2020

Hello

Firstly, thank you. The build xcframework is almost perfect, however I did run into a issue as of master (today) with de38500

The intermediate framework targets all build correctly, however, the final step of the framework building has invalid arguments to xcodebuild

Master as of this comment, produces the following output:

subprocess.CalledProcessError: Command '['xcodebuild', '-create-xcframework', '-output', './build/opencv2.xcframework', '-framework', './build/opencv2.xcframework', '-framework', './build/opencv2.xcframework', '-framework', './build/opencv2.xcframework', '-framework', './build/opencv2.xcframework']' returned non-zero exit status 70.

Which if you run as a command:

xcodebuild -create-xcframework -output ./build/opencv2.xcframework -framework ./build/opencv2.xcframework -framework ./build/opencv2.xcframework -framework ./build/opencv2.xcframework -framework ./build/opencv2.xcframework

Paying close attention, you'll notice we don't pass in our intermediate folders for say, iphonesimulator or the actual framework.

The correct script invocation is :

xcodebuild -create-xcframework -output ./build/opencv2.xcframework -framework ./build/catalyst/opencv2.framework -framework ./build/iphoneos/opencv2.framework -framework ./build/iphonesimulator/opencv2.framework -framework ./build/macos/opencv2.framework

Assuming ./build is the the second argument to the script.

Just a heads up.

@chrisballinger
Copy link
Copy Markdown
Contributor

chrisballinger commented Dec 10, 2020

@vade Thanks for the report! It might be best to make a new issue for it, because it's a ticket that needs to be resolved. It used to work, but I think maybe 77b986c or another recent commit inadvertently broke things.

@alalek We should get the GitHub Actions PR that checks the XCFramework build merged soon (and enabled for this repo) in order to prevent breakage in the future: #18976

@vade
Copy link
Copy Markdown

vade commented Dec 10, 2020

Sure, no worries. This seems almost like a one liner fix now that I'm looking at the build_xcframework.py

       xcframework_build_command = [
            "xcodebuild",
            "-create-xcframework",
            "-output",
            xcframework_path,
        ]
        for folder in build_folders:
            xcframework_build_command += ["-framework", xcframework_path]
        execute(xcframework_build_command, cwd=os.getcwd())

Should prob be

       xcframework_build_command = [
            "xcodebuild",
            "-create-xcframework",
            "-output",
            xcframework_path,
        ]
        for folder in build_folders:
            xcframework_build_command += ["-framework",  os.path.join(folder, "opencv2.framework") ]
        execute(xcframework_build_command, cwd=os.getcwd())

Considering this took a while to build for me, I can test this local change later and maybe submit a patch time permitting. I thought it prudent to just post and share my discoveries :) Thanks for the quick response!

@colejd
Copy link
Copy Markdown
Contributor Author

colejd commented Dec 10, 2020

It used to be like this:

for folder in build_folders:
    xcframework_build_command += ["-framework", "{}/{}.framework".format(folder, args.framework_name)]

So we just need to put that back, I think. I'll put in a PR.

@colejd
Copy link
Copy Markdown
Contributor Author

colejd commented Dec 10, 2020

Don't you love it when you go do a git blame and see your own name?

@colejd
Copy link
Copy Markdown
Contributor Author

colejd commented Dec 10, 2020

PR's in, @vade @alalek.

@sivrish
Copy link
Copy Markdown

sivrish commented Dec 11, 2020

I could see that build_xcframework.py doesn't support some arguments like --without to remove the unused modules. Will this be added in the future or I understood the script wrong ?

@colejd
Copy link
Copy Markdown
Contributor Author

colejd commented Dec 11, 2020

@sivrish any parameters that you supply that aren't recognized by the script will be passed through to the respective iOS/OSX build scripts. You should be able to use the --without parameter as normal.

@sivrish
Copy link
Copy Markdown

sivrish commented Dec 11, 2020

@colejd thanks for the clarification.

@sivrish
Copy link
Copy Markdown

sivrish commented Dec 11, 2020

@colejd I tried the script but it's adding an extra --without argument while running the script I think which results in an error.

Command I tried -

python opencv/platforms/apple/build_xcframework.py --without video --disable-bitcode --iphoneos_archs arm64 --iphonesimulator_archs arm64 --macos_archs arm64 --catalyst_archs arm64 opencv_xcframework

Error -

build_framework.py: error: argument --without: expected one argument

ERROR: Command '['python3', '/Users/sivrish-5137/Downloads/opencv/platforms/ios/build_framework.py', '--iphoneos_archs', 'arm64', '--framework_name', 'opencv2', '--build_only_specified_archs', './video/iphoneos', '--without', '--disable-bitcode', 'xcframework']' returned non-zero exit status 2.

The same args work on ios/build_framework.py

python opencv/platforms/ios/build_framework.py --without video --disable-bitcode --iphonesimulator_archs x86_64 --iphoneos_archs arm64 --build_only_specified_archs opencv_framework

@colejd
Copy link
Copy Markdown
Contributor Author

colejd commented Dec 11, 2020

@sivrish does --without=video work?

@colejd
Copy link
Copy Markdown
Contributor Author

colejd commented Dec 11, 2020

@sivrish Please make a new issue and tag me in it. The way the --without flag works is different than other flags that ask for a list of things, and I think this merits a followup PR to make clearer.

@sivrish
Copy link
Copy Markdown

sivrish commented Dec 11, 2020

@colejd sure, --without=video seems to work. The script is running now. I'll create a new issue as you asked.

@colejd colejd mentioned this pull request Dec 11, 2020
4 tasks
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
…catalyst-xcframework

Support XCFramework builds, Catalyst

* Early work on xcframework support

* Improve legibility

* Somehow this works

* Specify ABIs in a place where they won't get erased

If you pass in the C/CXX flags from the Python script, they won't be respected. By doing it in the actual toolchain, the options are respected and Catalyst successfully links.

* Clean up and push updates

* Actually use Catalyst ABI

Needed to specify EXE linker flags to get compiler tests to link to the Catalyst ABIs.

* Clean up

* Revert changes to common toolchain that don't matter

* Try some things

* Support Catalyst build in OSX scripts

* Remove unnecessary iOS reference to AssetsLibrary framework

* Getting closer

* Try some things, port to Python 3

* Some additional fixes

* Point Cmake Plist gen to osx directory for Catalyst targets

* Remove dynamic lib references for Catalyst, copy iOS instead of macos

* Add flag for building only specified archs, remove iOS catalyst refs

* Add build-xcframework.sh

* Update build-xcframework.sh

* Add presumptive Apple Silicon support

* Add arm64 iphonesimulator target

* Fix xcframework build

* Working on arm64 iOS simulator

* Support 2.7 (replace run with check_output)

* Correctly check output of uname_m against arch

* Clean up

* Use lipo for intermediate frameworks, add python script

Remove unneeded __init__.py

* Simplify python xcframework build script

* Add --only-64-bit flag

* Add --framework-name flag

* Document

* Commit to f-strings, improve console output

* Add i386 to iphonesimulator platform in xcframework generator

* Enable objc for non-Catalyst frameworks

* Fix xcframework builder for paths with spaces

* Use arch when specifying Catalyst build platform in build command

* Fix incorrect settings for framework_name argparse configuration

* Prefer underscores instead of hyphens in new flags

* Move Catalyst flags to where they'll actually get used

* Use --without=objc on Catalyst target for now

* Remove get_or_create_folder and simplify logic

* Remove unused import

* Tighten up help text

* Document

* Move common functions into cv_build_utils

* Improve documentation

* Remove old build script

* Add readme

* Check for required CMake and Xcode versions

* Clean up TODOs and re-enable `copy_samples()`

Remove TODO

Fixup

* Add missing print_function import

* Clarify CMake dependency documentation

* Revert python2 change in gen_objc

* Remove unnecessary builtins imports

* Remove trailing whitespace

* Avoid building Catalyst unless specified

This makes Catalyst support a non-breaking change, though defaults should be specified when a breaking change is possible.

* Prevent lipoing for the same archs on different platforms before build

* Rename build-xcframework.py to build_xcframework.py

* Check for duplicate archs more carefully

* Prevent sample copying error when directory already exists

This can happen when building multiple architectures for the same platform.

* Simplify code for checking for default archs

* Improve build_xcframework.py header text

* Correctly resolve Python script paths

* Parse only known args in ios/osx build_framework.py

* Pass through uncaptured args in build_xcframework to osx/ios build

* Fix typo

* Fix typo

* Fix unparameterized build path for intermediate frameworks

* Fix dyanmic info.plist path for catalyst

* Fix utf-8 Python 3 issue

* Add dynamic flag to osx script

* Rename platform to platforms, remove armv7s and i386

* Fix creation of dynamic framework on maccatalyst and macos

* Update platforms/apple/readme.md

* Add `macos_archs` flag and deprecate `archs` flag

* Allow specification of archs when generating xcframework from terminal

* Change xcframework platform argument names to match archs flag names

* Remove platforms as a concept and shadow archs flags from ios/osx .py

* Improve documentation

* Fix building of objc module on Catalyst, excluding Swift

* Clean up build folder logic a bit

* Fix framework_name flag

* Drop passthrough_args, use unknown_args instead

* minor: coding style changes

Co-authored-by: Chris Ballinger <cballinger@rightpoint.com>
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.

Mac Catalyst - xcframework support

7 participants