dynamically linked libs on mobile
authorMichael Klatis <michael.klatis@autodesk.com>
Sun, 10 Jul 2022 04:45:58 +0000 (21:45 -0700)
committerMichael Klatis <michael.klatis@autodesk.com>
Sun, 10 Jul 2022 04:45:58 +0000 (21:45 -0700)
platforms/android/build_sdk.py
platforms/ios/build_framework.py

index 88cb5ff..f445be1 100755 (executable)
@@ -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)
index 08d9fd6..12e7fdd 100755 (executable)
@@ -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",