Commit Graph

17 Commits

Author SHA1 Message Date
Jonathan Cole
743f1810c7
Merge pull request #19088 from Rightpoint:task/colejd/make-xcframework-output-path-explicit
Make xcframework output path argument explicit and required

* Make output path argument explicit and required

* Improve xcframework documentation

* Add TODOs for future breaking changes on build_framework.py scripts
2020-12-12 17:35:25 +00:00
Giles Payne
d1ea2ad143 CMake version checks for iOS and macOS builds 2020-12-10 21:43:26 +09:00
Jonathan Cole
85b0fb2a9c
Merge pull request #18826 from Rightpoint:feature/colejd/build-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>
2020-11-24 21:54:54 +00:00
Alexander Alekhin
9e84b860f2 cmake: update objc generator scripts
- allow to run generator without strong requirement of building 'objc' module
2020-11-14 20:59:55 +00:00
Giles Payne
60354e3901
Merge pull request #18094 from komakai:macos-universal-binary
* Universal Build for Big Sur

* Refactor MacOS/iOS build to only ever build one architecture at a time + improve code readability

* Workaround for CMake issue 20989
2020-08-30 01:41:54 +03:00
Giles Payne
bedabc15ae Obj-C/Swift docs improvements 2020-08-09 16:53:10 +09:00
Giles Payne
02385472b6
Merge pull request #17165 from komakai:objc-binding
Objc binding

* Initial work on Objective-C wrapper

* Objective-C generator script; update manually generated wrappers

* Add Mat tests

* Core Tests

* Imgproc wrapper generation and tests

* Fixes for Imgcodecs wrapper

* Miscellaneous fixes. Swift build support

* Objective-C wrapper build/install

* Add Swift wrappers for videoio/objdetect/feature2d

* Framework build;iOS support

* Fix toArray functions;Use enum types whenever possible

* Use enum types where possible;prepare test build

* Update test

* Add test runner scripts for iOS and macOS

* Add test scripts and samples

* Build fixes

* Fix build (cmake 3.17.x compatibility)

* Fix warnings

* Fix enum name conflicting handling

* Add support for document generation with Jazzy

* Swift/Native fast accessor functions

* Add Objective-C wrapper for calib3d, dnn, ml, photo and video modules

* Remove IntOut/FloatOut/DoubleOut classes

* Fix iOS default test platform value

* Fix samples

* Revert default framework name to opencv2

* Add converter util functions

* Fix failing test

* Fix whitespace

* Add handling for deprecated methods;fix warnings;define __OPENCV_BUILD

* Suppress cmake warnings

* Reduce severity of "jazzy not found" log message

* Fix incorrect #include of compatibility header in ios.h

* Use explicit returns in subscript/get implementation

* Reduce minimum required cmake version to 3.15 for Objective-C/Swift binding
2020-06-08 18:32:53 +00:00
Giles Payne
3cdbcc1645 Fix MacOS build 2019-11-13 21:10:08 +09:00
Giles Payne
96d5cbd036 Merge pull request #15350 from komakai:apple-debug-build
* Add debug build option to MacOs and iOS build scripts

* osx: allow selection of MACOSX_DEPLOYMENT_TARGET

* Add --debug_info flag to iOS and macOS builds for building with debug info
2019-08-23 18:22:29 +03:00
Adrian Kashivskyy
00285a5e88 Merge pull request #13424 from akashivskyy:pr/ios-nonfree
Add ability to build iOS and macOS frameworks with nonfree modules (#13424)

* Allow building ios framework with nonfree

* Allow building osx framework with nonfree
2018-12-12 17:32:19 +03:00
Yuriy Solovyov
96f1ef1347 Fix buildcmd 2017-05-02 18:59:37 +03:00
Yuriy Solovyov
4f6238aa04 Use all available cpu cores in iOS/OSX build procedure 2017-05-02 18:48:54 +03:00
Kyle Fleming
3d52661400 Set Mac OS X deployment target to 10.9
Without it set, the build will choose the current OS version as the deployment target. 10.9 is the earliest usable, since that is when OS X introduced libc++.
2017-04-16 14:39:26 -07:00
Dal Rupnik
576d43d1c2 Fixed build_framework.py script for osx 2017-01-24 19:14:50 +01:00
Ian MacLeod
b78f1ad823 Support for blacklisting modules when building iOS and OS X frameworks 2016-09-28 14:46:40 -07:00
Alexander Alekhin
be23846c4e update osx and ios build_framework.py 2015-12-17 16:17:31 +03:00
Ievgen Khvedchenia
92ead5fab3 Fix cmake to build OpenCV framework on OSX 2014-07-01 22:31:57 +03:00