Skip to content

Commit

Permalink
Universal Build for Big Sur (1st attempt)
Browse files Browse the repository at this point in the history
  • Loading branch information
komakai committed Aug 11, 2020
1 parent 949fe93 commit c33a1e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions platforms/ios/build_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ def makeFramework(self, outdir, builddirs):
"x86_64": "x86_64-apple-ios-simulator",
} if builddirs[0].find("iphone") != -1 else {
"x86_64": "x86_64-apple-macos",
"arm64": "arm64-apple-macos",
}
for d in builddirs:
copy_tree(os.path.join(d, "install", "lib", name + ".framework", "Modules"), os.path.join(dstdir, "Modules"))
Expand Down
6 changes: 5 additions & 1 deletion platforms/osx/build_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def getInfoPlist(self, builddirs):
parser.add_argument('--disable', metavar='FEATURE', default=[], action='append', help='OpenCV features to disable (add WITH_*=OFF)')
parser.add_argument('--enable_nonfree', default=False, dest='enablenonfree', action='store_true', help='enable non-free modules (disabled by default)')
parser.add_argument('--macosx_deployment_target', default=os.environ.get('MACOSX_DEPLOYMENT_TARGET', MACOSX_DEPLOYMENT_TARGET), help='specify MACOSX_DEPLOYMENT_TARGET')
parser.add_argument('--archs', default='x86_64', help='Select target ARCHS (set to "x86_64,arm64" to build Universal Binary for Big Sur and later)')
parser.add_argument('--debug', action='store_true', help='Build "Debug" binaries (CMAKE_BUILD_TYPE=Debug)')
parser.add_argument('--debug_info', action='store_true', help='Build with debug information (useful for Release mode: BUILD_WITH_DEBUG_INFO=ON)')
parser.add_argument('--framework_name', default='opencv2', dest='framework_name', action='store_true', help='Name of OpenCV framework (default: opencv2, will change to OpenCV in future version)')
Expand All @@ -54,13 +55,16 @@ def getInfoPlist(self, builddirs):

os.environ['MACOSX_DEPLOYMENT_TARGET'] = args.macosx_deployment_target
print('Using MACOSX_DEPLOYMENT_TARGET=' + os.environ['MACOSX_DEPLOYMENT_TARGET'])
archs = args.archs.split(',')
print('Using ARCHS=' + str(archs))

if args.legacy_build:
args.framework_name = "opencv2"
if not "objc" in args.without:
args.without.append("objc")

b = OSXBuilder(args.opencv, args.contrib, False, False, args.without, args.disable, args.enablenonfree,
[
(["x86_64"], "MacOSX")
(archs, "MacOSX")
], args.debug, args.debug_info, args.framework_name, args.run_tests, args.build_docs)
b.build(args.out)

0 comments on commit c33a1e6

Please sign in to comment.