mirror of
https://github.com/opencv/opencv.git
synced 2026-09-25 04:09:57 +03:00
Merge pull request #24136 from komakai:visionos_support
Add experimental support for Apple VisionOS platform #24136 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch This is dependent on cmake support for VisionOs which is currently in progress. Creating PR now to test that there are no regressions in iOS and macOS builds
This commit is contained in:
@@ -254,9 +254,9 @@ class Builder:
|
||||
toolchain = self.getToolchain(arch, target)
|
||||
cmakecmd = self.getCMakeArgs(arch, target) + \
|
||||
(["-DCMAKE_TOOLCHAIN_FILE=%s" % toolchain] if toolchain is not None else [])
|
||||
if target.lower().startswith("iphoneos"):
|
||||
if target.lower().startswith("iphoneos") or target.lower().startswith("xros"):
|
||||
cmakecmd.append("-DCPU_BASELINE=DETECT")
|
||||
if target.lower().startswith("iphonesimulator"):
|
||||
if target.lower().startswith("iphonesimulator") or target.lower().startswith("xrsimulator"):
|
||||
build_arch = check_output(["uname", "-m"]).decode('utf-8').rstrip()
|
||||
if build_arch != arch:
|
||||
print("build_arch (%s) != arch (%s)" % (build_arch, arch))
|
||||
@@ -341,7 +341,7 @@ class Builder:
|
||||
def makeDynamicLib(self, builddir):
|
||||
target = builddir[(builddir.rfind("build-") + 6):]
|
||||
target_platform = target[(target.rfind("-") + 1):]
|
||||
is_device = target_platform == "iphoneos" or target_platform == "catalyst"
|
||||
is_device = target_platform == "iphoneos" or target_platform == "visionos" or target_platform == "catalyst"
|
||||
framework_dir = os.path.join(builddir, "install", "lib", self.framework_name + ".framework")
|
||||
if not os.path.exists(framework_dir):
|
||||
os.makedirs(framework_dir)
|
||||
@@ -379,7 +379,7 @@ class Builder:
|
||||
"-framework", "CoreImage", "-framework", "CoreMedia", "-framework", "QuartzCore",
|
||||
"-framework", "Accelerate", "-framework", "OpenCL",
|
||||
]
|
||||
elif target_platform == "iphoneos" or target_platform == "iphonesimulator":
|
||||
elif target_platform == "iphoneos" or target_platform == "iphonesimulator" or target_platform == "xros" or target_platform == "xrsimulator":
|
||||
framework_options = [
|
||||
"-iframework", "%s/System/iOSSupport/System/Library/Frameworks" % sdk_dir,
|
||||
"-framework", "AVFoundation", "-framework", "CoreGraphics",
|
||||
|
||||
Reference in New Issue
Block a user