diff --git a/package/example/ios/FilamentExample.xcodeproj/project.pbxproj b/package/example/ios/FilamentExample.xcodeproj/project.pbxproj index f6a60fde..deea39be 100644 --- a/package/example/ios/FilamentExample.xcodeproj/project.pbxproj +++ b/package/example/ios/FilamentExample.xcodeproj/project.pbxproj @@ -14,16 +14,15 @@ 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 17023E1AC1A04AE0B6C140AC /* coin.glb in Resources */ = {isa = PBXBuildFile; fileRef = F43778A9F42D40A08F11D195 /* coin.glb */; }; + 4F84B0412C634799AEFB1D85 /* eye_full_texture_left_blue.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 134904F01F7041DFA331FD27 /* eye_full_texture_left_blue.jpg */; }; 59249653BB174593BEDB9F3D /* pengu.glb in Resources */ = {isa = PBXBuildFile; fileRef = 3E2439B417DA497E83EB1F05 /* pengu.glb */; }; 7699B88040F8A987B510C191 /* libPods-FilamentExample-FilamentExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-FilamentExample-FilamentExampleTests.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 94671BF6DAD54DF8A7B842C3 /* pirate.glb in Resources */ = {isa = PBXBuildFile; fileRef = 034C2E5BF6EE449290528E8D /* pirate.glb */; }; - FB6EB495362843928953B887 /* coin.glb in Resources */ = {isa = PBXBuildFile; fileRef = CE7EC55D9D25492D8D6083D3 /* coin.glb */; }; - 9D9B37A8229643988DE97B73 /* chair.glb in Resources */ = {isa = PBXBuildFile; fileRef = C4E5AB69D2B94D53A2EE3F93 /* chair.glb */; }; 9536532B97CA43669EE27CEC /* coin_alpha.glb in Resources */ = {isa = PBXBuildFile; fileRef = 12D4AF0DC82949E498A73CBE /* coin_alpha.glb */; }; - 4F84B0412C634799AEFB1D85 /* eye_full_texture_left_blue.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 134904F01F7041DFA331FD27 /* eye_full_texture_left_blue.jpg */; }; + 9D9B37A8229643988DE97B73 /* chair.glb in Resources */ = {isa = PBXBuildFile; fileRef = C4E5AB69D2B94D53A2EE3F93 /* chair.glb */; }; BDF34253C8964E78A0DCEAD2 /* eye_full_texture_right_blue.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 70AE03ED5F1844C6832C78BC /* eye_full_texture_right_blue.jpg */; }; + FB6EB495362843928953B887 /* coin.glb in Resources */ = {isa = PBXBuildFile; fileRef = CE7EC55D9D25492D8D6083D3 /* coin.glb */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -41,6 +40,8 @@ 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 00E356F21AD99517003FC87E /* FilamentExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FilamentExampleTests.m; sourceTree = ""; }; 034C2E5BF6EE449290528E8D /* pirate.glb */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = pirate.glb; path = ../assets/pirate.glb; sourceTree = ""; }; + 12D4AF0DC82949E498A73CBE /* coin_alpha.glb */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = coin_alpha.glb; path = ../assets/coin_alpha.glb; sourceTree = ""; }; + 134904F01F7041DFA331FD27 /* eye_full_texture_left_blue.jpg */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = eye_full_texture_left_blue.jpg; path = ../assets/eye_full_texture_left_blue.jpg; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* FilamentExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FilamentExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = FilamentExample/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = FilamentExample/AppDelegate.mm; sourceTree = ""; }; @@ -53,16 +54,14 @@ 5709B34CF0A7D63546082F79 /* Pods-FilamentExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FilamentExample.release.xcconfig"; path = "Target Support Files/Pods-FilamentExample/Pods-FilamentExample.release.xcconfig"; sourceTree = ""; }; 5B7EB9410499542E8C5724F5 /* Pods-FilamentExample-FilamentExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FilamentExample-FilamentExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-FilamentExample-FilamentExampleTests/Pods-FilamentExample-FilamentExampleTests.debug.xcconfig"; sourceTree = ""; }; 5DCACB8F33CDC322A6C60F78 /* libPods-FilamentExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-FilamentExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 70AE03ED5F1844C6832C78BC /* eye_full_texture_right_blue.jpg */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = eye_full_texture_right_blue.jpg; path = ../assets/eye_full_texture_right_blue.jpg; sourceTree = ""; }; 7A69823713B34897AF31CAF0 /* default_env_ibl.ktx */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = default_env_ibl.ktx; path = ../assets/default_env_ibl.ktx; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = FilamentExample/LaunchScreen.storyboard; sourceTree = ""; }; 89C6BE57DB24E9ADA2F236DE /* Pods-FilamentExample-FilamentExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FilamentExample-FilamentExampleTests.release.xcconfig"; path = "Target Support Files/Pods-FilamentExample-FilamentExampleTests/Pods-FilamentExample-FilamentExampleTests.release.xcconfig"; sourceTree = ""; }; BE173E0B3B23427D84C92C91 /* pijamas.glb */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = pijamas.glb; path = ../assets/pijamas.glb; sourceTree = ""; }; + C4E5AB69D2B94D53A2EE3F93 /* chair.glb */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = chair.glb; path = ../assets/chair.glb; sourceTree = ""; }; + CE7EC55D9D25492D8D6083D3 /* coin.glb */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = coin.glb; path = ../assets/coin.glb; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; - CE7EC55D9D25492D8D6083D3 /* coin.glb */ = {isa = PBXFileReference; name = "coin.glb"; path = "../assets/coin.glb"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - C4E5AB69D2B94D53A2EE3F93 /* chair.glb */ = {isa = PBXFileReference; name = "chair.glb"; path = "../assets/chair.glb"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 12D4AF0DC82949E498A73CBE /* coin_alpha.glb */ = {isa = PBXFileReference; name = "coin_alpha.glb"; path = "../assets/coin_alpha.glb"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 134904F01F7041DFA331FD27 /* eye_full_texture_left_blue.jpg */ = {isa = PBXFileReference; name = "eye_full_texture_left_blue.jpg"; path = "../assets/eye_full_texture_left_blue.jpg"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 70AE03ED5F1844C6832C78BC /* eye_full_texture_right_blue.jpg */ = {isa = PBXFileReference; name = "eye_full_texture_right_blue.jpg"; path = "../assets/eye_full_texture_right_blue.jpg"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ diff --git a/package/example/ios/Podfile.lock b/package/example/ios/Podfile.lock index a4132d53..777fba6c 100644 --- a/package/example/ios/Podfile.lock +++ b/package/example/ios/Podfile.lock @@ -886,75 +886,77 @@ PODS: - React-Mapbuffer (0.73.4): - glog - React-debug - - react-native-filament (0.8.0): + - react-native-filament (0.11.0): - glog - RCT-Folly (= 2022.05.16.00) - React-Core - - react-native-filament/camutils (= 0.8.0) - - react-native-filament/filamat (= 0.8.0) - - react-native-filament/filament (= 0.8.0) - - react-native-filament/gltfio_core (= 0.8.0) - - react-native-filament/image (= 0.8.0) - - react-native-filament/ktxreader (= 0.8.0) - - react-native-filament/math (= 0.8.0) - - react-native-filament/tsl (= 0.8.0) - - react-native-filament/uberz (= 0.8.0) - - react-native-filament/utils (= 0.8.0) - - react-native-filament/camutils (0.8.0): + - react-native-filament/camutils (= 0.11.0) + - react-native-filament/filamat (= 0.11.0) + - react-native-filament/filament (= 0.11.0) + - react-native-filament/gltfio_core (= 0.11.0) + - react-native-filament/image (= 0.11.0) + - react-native-filament/ktxreader (= 0.11.0) + - react-native-filament/math (= 0.11.0) + - react-native-filament/tsl (= 0.11.0) + - react-native-filament/uberz (= 0.11.0) + - react-native-filament/utils (= 0.11.0) + - react-native-filament/camutils (0.11.0): - glog - RCT-Folly (= 2022.05.16.00) - React-Core - react-native-filament/math - - react-native-filament/filamat (0.8.0): + - react-native-filament/filamat (0.11.0): - glog - RCT-Folly (= 2022.05.16.00) - React-Core - react-native-filament/math - react-native-filament/utils - - react-native-filament/filament (0.8.0): + - react-native-filament/filament (0.11.0): - glog - RCT-Folly (= 2022.05.16.00) - React-Core - react-native-filament/math - react-native-filament/utils - - react-native-filament/gltfio_core (0.8.0): + - react-native-filament/gltfio_core (0.11.0): - glog - RCT-Folly (= 2022.05.16.00) - React-Core - react-native-filament/filament - react-native-filament/ktxreader - react-native-filament/uberz - - react-native-filament/image (0.8.0): + - react-native-filament/image (0.11.0): - glog - RCT-Folly (= 2022.05.16.00) - React-Core - react-native-filament/filament - - react-native-filament/ktxreader (0.8.0): + - react-native-filament/ktxreader (0.11.0): - glog - RCT-Folly (= 2022.05.16.00) - React-Core - react-native-filament/filament - react-native-filament/image - - react-native-filament/math (0.8.0): + - react-native-filament/math (0.11.0): - glog - RCT-Folly (= 2022.05.16.00) - React-Core - - react-native-filament/tsl (0.8.0): + - react-native-filament/tsl (0.11.0): - glog - RCT-Folly (= 2022.05.16.00) - React-Core - - react-native-filament/uberz (0.8.0): + - react-native-filament/uberz (0.11.0): - glog - RCT-Folly (= 2022.05.16.00) - React-Core - react-native-filament/filamat - react-native-filament/tsl - react-native-filament/utils - - react-native-filament/utils (0.8.0): + - react-native-filament/utils (0.11.0): - glog - RCT-Folly (= 2022.05.16.00) - React-Core - react-native-filament/tsl + - react-native-safe-area-context (4.9.0): + - React-Core - React-nativeconfig (0.73.4) - React-NativeModulesApple (0.73.4): - glog @@ -1122,6 +1124,10 @@ PODS: - React-jsi (= 0.73.4) - React-logger (= 0.73.4) - React-perflogger (= 0.73.4) + - RNScreens (3.29.0): + - glog + - RCT-Folly (= 2022.05.16.00) + - React-Core - SocketRocket (0.6.1) - Yoga (1.14.0) @@ -1157,6 +1163,7 @@ DEPENDENCIES: - React-logger (from `../node_modules/react-native/ReactCommon/logger`) - React-Mapbuffer (from `../node_modules/react-native/ReactCommon`) - react-native-filament (from `../..`) + - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) - React-nativeconfig (from `../node_modules/react-native/ReactCommon`) - React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`) - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) @@ -1177,6 +1184,7 @@ DEPENDENCIES: - React-runtimescheduler (from `../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`) - React-utils (from `../node_modules/react-native/ReactCommon/react/utils`) - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) + - RNScreens (from `../node_modules/react-native-screens`) - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) SPEC REPOS: @@ -1243,6 +1251,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon" react-native-filament: :path: "../.." + react-native-safe-area-context: + :path: "../node_modules/react-native-safe-area-context" React-nativeconfig: :path: "../node_modules/react-native/ReactCommon" React-NativeModulesApple: @@ -1283,6 +1293,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/react/utils" ReactCommon: :path: "../node_modules/react-native/ReactCommon" + RNScreens: + :path: "../node_modules/react-native-screens" Yoga: :path: "../node_modules/react-native/ReactCommon/yoga" @@ -1316,7 +1328,8 @@ SPEC CHECKSUMS: React-jsinspector: 9ac353eccf6ab54d1e0a33862ba91221d1e88460 React-logger: 0a57b68dd2aec7ff738195f081f0520724b35dab React-Mapbuffer: 63913773ed7f96b814a2521e13e6d010282096ad - react-native-filament: c69afb4f5e2ec86b4773aa03b2ee19ec08a46015 + react-native-filament: 3342867c90546663d3c2f8c8b2566d21e5100684 + react-native-safe-area-context: b97eb6f9e3b7f437806c2ce5983f479f8eb5de4b React-nativeconfig: d7af5bae6da70fa15ce44f045621cf99ed24087c React-NativeModulesApple: 0123905d5699853ac68519607555a9a4f5c7b3ac React-perflogger: 8a1e1af5733004bdd91258dcefbde21e0d1faccd @@ -1337,6 +1350,7 @@ SPEC CHECKSUMS: React-runtimescheduler: ed48e5faac6751e66ee1261c4bd01643b436f112 React-utils: 6e5ad394416482ae21831050928ae27348f83487 ReactCommon: 840a955d37b7f3358554d819446bffcf624b2522 + RNScreens: b582cb834dc4133307562e930e8fa914b8c04ef2 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 Yoga: 64cd2a583ead952b0315d5135bf39e053ae9be70 diff --git a/package/filament_ios_simulator.patch b/package/filament_ios_simulator.patch new file mode 100644 index 00000000..01b4841a --- /dev/null +++ b/package/filament_ios_simulator.patch @@ -0,0 +1,397 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b18c4a5b4ed..e032ccb20bd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -604,7 +604,11 @@ endif() + string(TOLOWER "${DIST_ARCH}" DIST_ARCH) + string(REPLACE "amd64" "x86_64" DIST_ARCH "${DIST_ARCH}") + if (NOT DIST_DIR) +- set(DIST_DIR "${DIST_ARCH}") ++ if(PLATFORM_NAME) ++ set(DIST_DIR "${DIST_ARCH}-${PLATFORM_NAME}") ++ else() ++ set(DIST_DIR "${DIST_ARCH}") ++ endif() + endif() + + # ================================================================================================== +diff --git a/build.sh b/build.sh +index 56562cc1c6c..e4b26a99d85 100755 +--- a/build.sh ++++ b/build.sh +@@ -581,9 +581,9 @@ function build_ios_target { + local platform=$3 + + echo "Building iOS ${lc_target} (${arch}) for ${platform}..." +- mkdir -p "out/cmake-ios-${lc_target}-${arch}" ++ mkdir -p "out/cmake-ios-${lc_target}-${arch}-${platform}" + +- pushd "out/cmake-ios-${lc_target}-${arch}" > /dev/null ++ pushd "out/cmake-ios-${lc_target}-${arch}-${platform}" > /dev/null + + if [[ ! -d "CMakeFiles" ]] || [[ "${ISSUE_CMAKE_ALWAYS}" == "true" ]]; then + cmake \ +@@ -598,14 +598,14 @@ function build_ios_target { + ${MATDBG_OPTION} \ + ${MATOPT_OPTION} \ + ../.. +- ln -sf "out/cmake-ios-${lc_target}-${arch}/compile_commands.json" \ ++ ln -sf "out/cmake-ios-${lc_target}-${arch}-${platform}/compile_commands.json" \ + ../../compile_commands.json + fi + + ${BUILD_COMMAND} + + if [[ "${INSTALL_COMMAND}" ]]; then +- echo "Installing ${lc_target} in out/${lc_target}/filament..." ++ echo "Installing ${lc_target}-${arch}-${platform} in out/${lc_target}/filament..." + ${BUILD_COMMAND} ${INSTALL_COMMAND} + fi + +@@ -640,16 +640,26 @@ function build_ios { + if [[ "${ISSUE_DEBUG_BUILD}" == "true" ]]; then + build_ios_target "Debug" "arm64" "iphoneos" + if [[ "${IOS_BUILD_SIMULATOR}" == "true" ]]; then ++ build_ios_target "Debug" "arm64" "iphonesimulator" + build_ios_target "Debug" "x86_64" "iphonesimulator" + fi +- ++ + if [[ "${BUILD_UNIVERSAL_LIBRARIES}" == "true" ]]; then + build/ios/create-universal-libs.sh \ +- -o out/ios-debug/filament/lib/universal \ +- out/ios-debug/filament/lib/arm64 \ +- out/ios-debug/filament/lib/x86_64 +- rm -rf out/ios-debug/filament/lib/arm64 +- rm -rf out/ios-debug/filament/lib/x86_64 ++ -o ./out/ios-debug/filament/lib/universal \ ++ ./out/ios-debug/filament/lib/arm64-iphonesimulator \ ++ ./out/ios-debug/filament/lib/x86_64-iphonesimulator ++ ++ rm -rf out/ios-debug/filament/lib/x86_64-iphonesimulator ++ rm -rf out/ios-debug/filament/lib/arm64-iphonesimulator ++ ++ build/ios/create-xc-frameworks.sh \ ++ -o out/ios-debug/filament/lib \ ++ out/ios-debug/filament/lib/arm64-iphoneos \ ++ out/ios-debug/filament/lib/universal ++ ++ rm -rf out/ios-debug/filament/lib/universal ++ rm -rf out/ios-debug/filament/lib/arm64-iphoneos + fi + + archive_ios "Debug" +@@ -658,16 +668,26 @@ function build_ios { + if [[ "${ISSUE_RELEASE_BUILD}" == "true" ]]; then + build_ios_target "Release" "arm64" "iphoneos" + if [[ "${IOS_BUILD_SIMULATOR}" == "true" ]]; then ++ build_ios_target "Release" "arm64" "iphonesimulator" + build_ios_target "Release" "x86_64" "iphonesimulator" + fi +- ++ + if [[ "${BUILD_UNIVERSAL_LIBRARIES}" == "true" ]]; then + build/ios/create-universal-libs.sh \ +- -o out/ios-release/filament/lib/universal \ +- out/ios-release/filament/lib/arm64 \ +- out/ios-release/filament/lib/x86_64 +- rm -rf out/ios-release/filament/lib/arm64 +- rm -rf out/ios-release/filament/lib/x86_64 ++ -o ./out/ios-release/filament/lib/universal \ ++ ./out/ios-release/filament/lib/arm64-iphonesimulator \ ++ ./out/ios-release/filament/lib/x86_64-iphonesimulator ++ ++ rm -rf out/ios-release/filament/lib/x86_64-iphonesimulator ++ rm -rf out/ios-release/filament/lib/arm64-iphonesimulator ++ ++ build/ios/create-xc-frameworks.sh \ ++ -o out/ios-release/filament/lib \ ++ out/ios-release/filament/lib/arm64-iphoneos \ ++ out/ios-release/filament/lib/universal ++ ++ rm -rf out/ios-release/filament/lib/universal ++ rm -rf out/ios-release/filament/lib/arm64-iphoneos + fi + + archive_ios "Release" +diff --git a/build/ios/create-xc-frameworks.sh b/build/ios/create-xc-frameworks.sh +new file mode 100755 +index 00000000000..d8981ec9c36 +--- /dev/null ++++ b/build/ios/create-xc-frameworks.sh +@@ -0,0 +1,107 @@ ++#!/usr/bin/env bash ++ ++set -e ++ ++function print_help { ++ local SELF_NAME ++ SELF_NAME=$(basename "$0") ++ echo "$SELF_NAME. Combine multiple single-architecture or universal libraries into xc-frameworks." ++ echo "" ++ echo "Usage:" ++ echo " $SELF_NAME [options] ..." ++ echo "" ++ echo "Options:" ++ echo " -h" ++ echo " Print this help message." ++ echo " -o" ++ echo " Output directory to store the xcframeworks libraries." ++ echo "" ++ echo "Example:" ++ echo " Given the follow directories:" ++ echo " ├── universal/" ++ echo " │ └── libfoo.a <- universal library - ensure they share the same platform (iphone/simulator)" ++ echo " └── arm64-iphoneos/" ++ echo " └── libfoo.a <- arm64 iphoneos platform" ++ echo "" ++ echo " $SELF_NAME -o frameworks/ arm64-iphoneos/ universal/" ++ echo "" ++ echo " Each library is combined into an xc-framework:" ++ echo " └── frameworks/" ++ echo " └── libfoo.xcframework" ++ echo "" ++ echo "Each should contain one or more single or universal-architecture static libraries." ++ echo "All s should contain the same number of libraries, with the same names." ++} ++ ++OUTPUT_DIR="" ++while getopts "ho:" opt; do ++ case ${opt} in ++ h) ++ print_help ++ exit 1 ++ ;; ++ o) ++ OUTPUT_DIR="${OPTARG}" ++ ;; ++ *) ++ print_help ++ exit 1 ++ ;; ++ esac ++done ++ ++shift $((OPTIND - 1)) ++ ++PATHS=("$@") ++ ++if [[ ! "${PATHS[*]}" ]]; then ++ echo "One or more paths required." ++ print_help ++ exit 1 ++fi ++ ++if [[ ! "${OUTPUT_DIR}" ]]; then ++ echo "Output directory required." ++ print_help ++ exit 1 ++fi ++ ++# Create the output directory, if it doesn't exist already. ++mkdir -p "${OUTPUT_DIR}" ++ ++# Use the first path as the "leader" path. All paths should contain the same number of files with ++# the same names, so it doesn't matter which we chose. ++LEADER_PATH="${PATHS[0]}" ++ ++echo "Creating universal libraries from path: ${LEADER_PATH}..." ++ ++# Loop through each file in the leader path. For each library we find, we'll collect additional ++# architectures in the other paths and combine them all into a universal library. ++for FILE in "${LEADER_PATH}"/*.a; do ++ [ -f "${FILE}" ] || continue ++ ++ # The static library file name, like "libfilament.a" ++ LIBRARY_NAME="${FILE##*/}" ++ ++ INPUT_FILES=("-library ${LEADER_PATH}/${LIBRARY_NAME}") ++ for ARCH_PATH in "${PATHS[@]:1}"; do ++ THIS_FILE="${ARCH_PATH}/${LIBRARY_NAME}" ++ if [[ -f "${THIS_FILE}" ]]; then ++ INPUT_FILES+=("-library ${THIS_FILE}") ++ else ++ echo "Error: ${THIS_FILE} does not exist." ++ exit 1 ++ fi ++ done ++ ++ # Remove the .a extension ++ LIBRARY_NAME="${LIBRARY_NAME%.a}" ++ ++ OUTPUT="${OUTPUT_DIR}/${LIBRARY_NAME}.xcframework" ++ # Delete previous xcframework ++ rm -rf $OUTPUT ++ ++ # Create the xcframework command and execute it ++ CMD="xcodebuild -create-xcframework ${INPUT_FILES[@]} -output ${OUTPUT}" ++ eval $CMD ++done +diff --git a/ios/CocoaPods/Filament.podspec b/ios/CocoaPods/Filament.podspec +index 513d6c19752..d93a1ed1abd 100644 +--- a/ios/CocoaPods/Filament.podspec ++++ b/ios/CocoaPods/Filament.podspec +@@ -8,12 +8,6 @@ Pod::Spec.new do |spec| + spec.platform = :ios, "11.0" + spec.source = { :http => "https://github.com/google/filament/releases/download/v1.51.0/filament-v1.51.0-ios.tgz" } + +- # Fix linking error with Xcode 12; we do not yet support the simulator on Apple silicon. +- spec.pod_target_xcconfig = { +- 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' +- } +- spec.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' } +- + spec.subspec "filament" do |ss| + ss.source_files = + "include/filament/*.h", +@@ -23,13 +17,13 @@ Pod::Spec.new do |spec| + "include/ibl/*.h", + "include/geometry/*.h" + ss.header_mappings_dir = "include" +- ss.vendored_libraries = +- "lib/universal/libfilament.a", +- "lib/universal/libbackend.a", +- "lib/universal/libfilabridge.a", +- "lib/universal/libfilaflat.a", +- "lib/universal/libibl.a", +- "lib/universal/libgeometry.a" ++ ss.vendored_frameworks = ++ "lib/libfilament.xcframework", ++ "lib/libbackend.xcframework", ++ "lib/libfilabridge.xcframework", ++ "lib/libfilaflat.xcframework", ++ "lib/libibl.xcframework", ++ "lib/libgeometry.xcframework" + ss.dependency "Filament/utils" + ss.dependency "Filament/math" + end +@@ -40,11 +34,11 @@ Pod::Spec.new do |spec| + "include/filament/MaterialChunkType.h", + "include/filament/MaterialEnums.h" + ss.header_mappings_dir = "include" +- ss.vendored_libraries = +- "lib/universal/libfilamat.a", +- "lib/universal/libshaders.a", +- "lib/universal/libsmol-v.a", +- "lib/universal/libfilabridge.a" ++ ss.vendored_frameworks = ++ "lib/libfilamat.xcframework", ++ "lib/libshaders.xcframework", ++ "lib/libsmol-v.xcframework", ++ "lib/libfilabridge.xcframework" + ss.dependency "Filament/utils" + ss.dependency "Filament/math" + end +@@ -52,11 +46,11 @@ Pod::Spec.new do |spec| + spec.subspec "gltfio_core" do |ss| + ss.source_files = "include/gltfio/**/*.h" + ss.header_mappings_dir = "include" +- ss.vendored_libraries = +- "lib/universal/libgltfio_core.a", +- "lib/universal/libdracodec.a", +- "lib/universal/libuberarchive.a", +- "lib/universal/libstb.a" ++ ss.vendored_frameworks = ++ "lib/libgltfio_core.xcframework", ++ "lib/libdracodec.xcframework", ++ "lib/libuberarchive.xcframework", ++ "lib/libstb.xcframework" + ss.dependency "Filament/filament" + ss.dependency "Filament/ktxreader" + ss.dependency "Filament/uberz" +@@ -64,23 +58,23 @@ Pod::Spec.new do |spec| + + spec.subspec "camutils" do |ss| + ss.source_files = "include/camutils/*.h" +- ss.vendored_libraries = "lib/universal/libcamutils.a" ++ ss.vendored_frameworks = "lib/libcamutils.xcframework" + ss.header_dir = "camutils" + ss.dependency "Filament/math" + end + + spec.subspec "filameshio" do |ss| + ss.source_files = "include/filameshio/*.h" +- ss.vendored_libraries = +- "lib/universal/libfilameshio.a", +- "lib/universal/libmeshoptimizer.a" ++ ss.vendored_frameworks = ++ "lib/libfilameshio.xcframework", ++ "lib/libmeshoptimizer.xcframework" + ss.header_dir = "filameshio" + ss.dependency "Filament/filament" + end + + spec.subspec "image" do |ss| + ss.source_files = "include/image/*.h" +- ss.vendored_libraries = "lib/universal/libimage.a" ++ ss.vendored_frameworks = "lib/libimage.xcframework" + ss.header_dir = "image" + ss.dependency "Filament/filament" + end +@@ -88,7 +82,7 @@ Pod::Spec.new do |spec| + spec.subspec "utils" do |ss| + ss.source_files = "include/utils/**/*.h" + ss.header_mappings_dir = "include" +- ss.vendored_libraries = "lib/universal/libutils.a" ++ ss.vendored_frameworks = "lib/libutils.xcframework" + ss.dependency "Filament/tsl" + end + +@@ -105,9 +99,9 @@ Pod::Spec.new do |spec| + spec.subspec "ktxreader" do |ss| + ss.source_files = "include/ktxreader/*.h" + ss.header_mappings_dir = "include" +- ss.vendored_libraries = +- "lib/universal/libktxreader.a", +- "lib/universal/libbasis_transcoder.a" ++ ss.vendored_frameworks = ++ "lib/libktxreader.xcframework", ++ "lib/libbasis_transcoder.xcframework" + ss.dependency "Filament/image" + ss.dependency "Filament/filament" + end +@@ -115,9 +109,9 @@ Pod::Spec.new do |spec| + spec.subspec "viewer" do |ss| + ss.source_files = "include/viewer/*.h" + ss.header_mappings_dir = "include" +- ss.vendored_libraries = +- "lib/universal/libviewer.a", +- "lib/universal/libcivetweb.a" ++ ss.vendored_frameworks = ++ "lib/libviewer.xcframework", ++ "lib/libcivetweb.xcframework" + ss.dependency "Filament/filament" + ss.dependency "Filament/gltfio_core" + end +@@ -125,9 +119,9 @@ Pod::Spec.new do |spec| + spec.subspec "uberz" do |ss| + ss.source_files = "include/uberz/*.h" + ss.header_mappings_dir = "include" +- ss.vendored_libraries = +- "lib/universal/libuberzlib.a", +- "lib/universal/libzstd.a" ++ ss.vendored_frameworks = ++ "lib/libuberzlib.xcframework", ++ "lib/libzstd.xcframework" + ss.header_dir = "uberz" + ss.dependency "Filament/filamat" + ss.dependency "Filament/tsl" +diff --git a/third_party/clang/iOS.cmake b/third_party/clang/iOS.cmake +index a5619558834..6153cf8641e 100644 +--- a/third_party/clang/iOS.cmake ++++ b/third_party/clang/iOS.cmake +@@ -103,7 +103,12 @@ IF (NOT DEFINED IOS_MIN_TARGET) + OUTPUT_STRIP_TRAILING_WHITESPACE) + ENDIF() + +-SET(IOS_COMMON_FLAGS "-m${PLATFORM_FLAG_NAME}-version-min=${IOS_MIN_TARGET}") ++if(PLATFORM_NAME STREQUAL "iphonesimulator") ++ # Ensure that the simulator is built with the correct target ++ SET(IOS_COMMON_FLAGS "-m${PLATFORM_FLAG_NAME}-version-min=${IOS_MIN_TARGET} -target ${IOS_ARCH}-apple-ios-simulator") ++else() ++ SET(IOS_COMMON_FLAGS "-m${PLATFORM_FLAG_NAME}-version-min=${IOS_MIN_TARGET}") ++endif() + + SET(CMAKE_C_FLAGS_INIT "${IOS_COMMON_FLAGS}") + SET(CMAKE_CXX_FLAGS_INIT "${IOS_COMMON_FLAGS}") + \ No newline at end of file diff --git a/package/package.json b/package/package.json index ba7a75db..5729b3d7 100644 --- a/package/package.json +++ b/package/package.json @@ -33,7 +33,7 @@ "clean": "rm -rf android/build example/android/build example/android/app/build example/ios/build lib", "prepare": "git submodule update --init --recursive && yarn patch-filament && bob build", "update-submodule": "git submodule update --remote --merge", - "patch-filament": "cd ../filament ; git apply ../package/filament_animator_feat.patch && git apply ../package/filament_material_instance_getter.patch ; cd -", + "patch-filament": "cd ../filament ; git apply ../package/filament_animator_feat.patch ; git apply ../package/filament_material_instance_getter.patch ; git apply ../package/filament_ios_simulator.patch ; cd -", "build-filament": "yarn patch-filament && scripts/build-filament.sh", "build-bullet3": "scripts/build-bullet3.sh", "release": "yarn build-filament && yarn build-bullet3 && release-it" diff --git a/package/react-native-filament.podspec b/package/react-native-filament.podspec index 60dca23e..2a91c600 100644 --- a/package/react-native-filament.podspec +++ b/package/react-native-filament.podspec @@ -36,20 +36,20 @@ Pod::Spec.new do |s| "ios/libs/filament/include/ibl/*.h", "ios/libs/filament/include/geometry/*.h" ss.header_mappings_dir = "ios/libs/filament/include" - ss.vendored_libraries = - "ios/libs/filament/lib/universal/libfilament.a", - "ios/libs/filament/lib/universal/libbackend.a", - "ios/libs/filament/lib/universal/libfilabridge.a", - "ios/libs/filament/lib/universal/libfilaflat.a", - "ios/libs/filament/lib/universal/libibl.a", - "ios/libs/filament/lib/universal/libgeometry.a" + ss.vendored_frameworks = + "ios/libs/filament/lib/libfilament.xcframework", + "ios/libs/filament/lib/libbackend.xcframework", + "ios/libs/filament/lib/libfilabridge.xcframework", + "ios/libs/filament/lib/libfilaflat.xcframework", + "ios/libs/filament/lib/libibl.xcframework", + "ios/libs/filament/lib/libgeometry.xcframework" ss.dependency "react-native-filament/utils" ss.dependency "react-native-filament/math" end s.subspec "camutils" do |ss| ss.source_files = "ios/libs/filament/include/camutils/*.h" - ss.vendored_libraries = "ios/libs/filament/lib/universal/libcamutils.a" + ss.vendored_frameworks = "ios/libs/filament/lib/libcamutils.xcframework" ss.header_dir = "camutils" ss.dependency "react-native-filament/math" end @@ -57,7 +57,7 @@ Pod::Spec.new do |s| s.subspec "utils" do |ss| ss.source_files = "ios/libs/filament/include/utils/**/*.h" ss.header_mappings_dir = "ios/libs/filament/include" - ss.vendored_libraries = "ios/libs/filament/lib/universal/libutils.a" + ss.vendored_frameworks = "ios/libs/filament/lib/libutils.xcframework" ss.dependency "react-native-filament/tsl" end @@ -77,18 +77,18 @@ Pod::Spec.new do |s| "ios/libs/filament/include/filament/MaterialChunkType.h", "ios/libs/filament/include/filament/MaterialEnums.h" ss.header_mappings_dir = "ios/libs/filament/include" - ss.vendored_libraries = - "ios/libs/filament/lib/universal/libfilamat.a", - "ios/libs/filament/lib/universal/libshaders.a", - "ios/libs/filament/lib/universal/libsmol-v.a", - "ios/libs/filament/lib/universal/libfilabridge.a" + ss.vendored_frameworks = + "ios/libs/filament/lib/libfilamat.xcframework", + "ios/libs/filament/lib/libshaders.xcframework", + "ios/libs/filament/lib/libsmol-v.xcframework", + "ios/libs/filament/lib/libfilabridge.xcframework" ss.dependency "react-native-filament/utils" ss.dependency "react-native-filament/math" end s.subspec "image" do |ss| ss.source_files = "ios/libs/filament/include/image/*.h" - ss.vendored_libraries = "ios/libs/filament/lib/universal/libimage.a" + ss.vendored_frameworks = "ios/libs/filament/lib/libimage.xcframework" ss.header_dir = "image" ss.dependency "react-native-filament/filament" end @@ -96,9 +96,9 @@ Pod::Spec.new do |s| s.subspec "ktxreader" do |ss| ss.source_files = "ios/libs/filament/include/ktxreader/*.h" ss.header_mappings_dir = "ios/libs/filament/include" - ss.vendored_libraries = - "ios/libs/filament/lib/universal/libktxreader.a", - "ios/libs/filament/lib/universal/libbasis_transcoder.a" + ss.vendored_frameworks = + "ios/libs/filament/lib/libktxreader.xcframework", + "ios/libs/filament/lib/libbasis_transcoder.xcframework" ss.dependency "react-native-filament/image" ss.dependency "react-native-filament/filament" end @@ -106,9 +106,9 @@ Pod::Spec.new do |s| s.subspec "uberz" do |ss| ss.source_files = "ios/libs/filament/include/uberz/*.h" ss.header_mappings_dir = "ios/libs/filament/include" - ss.vendored_libraries = - "ios/libs/filament/lib/universal/libuberzlib.a", - "ios/libs/filament/lib/universal/libzstd.a" + ss.vendored_frameworks = + "ios/libs/filament/lib/libuberzlib.xcframework", + "ios/libs/filament/lib/libzstd.xcframework" ss.header_dir = "uberz" ss.dependency "react-native-filament/filamat" ss.dependency "react-native-filament/tsl" @@ -118,11 +118,11 @@ Pod::Spec.new do |s| s.subspec "gltfio_core" do |ss| ss.source_files = "ios/libs/filament/include/gltfio/**/*.h" ss.header_mappings_dir = "ios/libs/filament/include" - ss.vendored_libraries = - "ios/libs/filament/lib/universal/libgltfio_core.a", - "ios/libs/filament/lib/universal/libdracodec.a", - "ios/libs/filament/lib/universal/libuberarchive.a", - "ios/libs/filament/lib/universal/libstb.a" + ss.vendored_frameworks = + "ios/libs/filament/lib/libgltfio_core.xcframework", + "ios/libs/filament/lib/libdracodec.xcframework", + "ios/libs/filament/lib/libuberarchive.xcframework", + "ios/libs/filament/lib/libstb.xcframework" ss.dependency "react-native-filament/filament" ss.dependency "react-native-filament/ktxreader" ss.dependency "react-native-filament/uberz"