From: Michael Klatis Date: Sun, 10 Jul 2022 04:45:58 +0000 (-0700) Subject: dynamically linked libs on mobile X-Git-Tag: accepted/tizen/unified/20230127.161057~1^2~231^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d3dbcb0273ae1c89b585506031152aa0cf011be;p=platform%2Fupstream%2Fopencv.git dynamically linked libs on mobile --- diff --git a/platforms/android/build_sdk.py b/platforms/android/build_sdk.py index 88cb5ff..f445be1 100755 --- a/platforms/android/build_sdk.py +++ b/platforms/android/build_sdk.py @@ -160,6 +160,7 @@ class Builder: self.no_samples_build = True if config.no_samples_build else False self.opencl = True if config.opencl else False self.no_kotlin = True if config.no_kotlin else False + self.shared = True if config.shared else False def get_cmake(self): if not self.config.use_android_buildtools and check_executable(['cmake', '--version']): @@ -245,6 +246,9 @@ class Builder: if self.no_kotlin: cmake_vars['BUILD_KOTLIN_EXTENSIONS'] = "OFF" + if self.shared: + cmake_vars['BUILD_SHARED_LIBS'] = "ON" + if self.config.modules_list is not None: cmd.append("-DBUILD_LIST='%s'" % self.config.modules_list) @@ -365,6 +369,7 @@ if __name__ == "__main__": parser.add_argument('--no_samples_build', action="store_true", help="Do not build samples (speeds up build)") parser.add_argument('--opencl', action="store_true", help="Enable OpenCL support") parser.add_argument('--no_kotlin', action="store_true", help="Disable Kotlin extensions") + parser.add_argument('--shared', action="store_true", help="Build shared libraries") args = parser.parse_args() log.basicConfig(format='%(message)s', level=log.DEBUG) diff --git a/platforms/ios/build_framework.py b/platforms/ios/build_framework.py index 08d9fd6..12e7fdd 100755 --- a/platforms/ios/build_framework.py +++ b/platforms/ios/build_framework.py @@ -379,6 +379,13 @@ class Builder: "-framework", "CoreImage", "-framework", "CoreMedia", "-framework", "QuartzCore", "-framework", "Accelerate", "-framework", "OpenCL", ] + elif target_platform == "iphoneos" or target_platform == "iphonesimulator": + framework_options = [ + "-iframework", "%s/System/iOSSupport/System/Library/Frameworks" % sdk_dir, + "-framework", "AVFoundation", "-framework", "CoreGraphics", + "-framework", "CoreImage", "-framework", "CoreMedia", "-framework", "QuartzCore", + "-framework", "Accelerate", "-framework", "UIKit", "-framework", "CoreVideo", + ] execute([ "clang++", "-Xlinker", "-rpath",