diff --git a/package/example/ios/Podfile.lock b/package/example/ios/Podfile.lock index f6f3ec99..6780fba8 100644 --- a/package/example/ios/Podfile.lock +++ b/package/example/ios/Podfile.lock @@ -890,6 +890,29 @@ PODS: - glog - RCT-Folly (= 2022.05.16.00) - React-Core + - react-native-filament/filament (= 0.0.1) + - react-native-filament/math (= 0.0.1) + - react-native-filament/tsl (= 0.0.1) + - react-native-filament/utils (= 0.0.1) + - react-native-filament/filament (0.0.1): + - glog + - RCT-Folly (= 2022.05.16.00) + - React-Core + - react-native-filament/math + - react-native-filament/utils + - react-native-filament/math (0.0.1): + - glog + - RCT-Folly (= 2022.05.16.00) + - React-Core + - react-native-filament/tsl (0.0.1): + - glog + - RCT-Folly (= 2022.05.16.00) + - React-Core + - react-native-filament/utils (0.0.1): + - glog + - RCT-Folly (= 2022.05.16.00) + - React-Core + - react-native-filament/tsl - React-nativeconfig (0.73.4) - React-NativeModulesApple (0.73.4): - glog @@ -1251,7 +1274,7 @@ SPEC CHECKSUMS: React-jsinspector: 9ac353eccf6ab54d1e0a33862ba91221d1e88460 React-logger: 0a57b68dd2aec7ff738195f081f0520724b35dab React-Mapbuffer: 63913773ed7f96b814a2521e13e6d010282096ad - react-native-filament: 1b13815f2d7a30c487491de604152a49e85c69d7 + react-native-filament: 782dc32b84c384b29dcccedeb3e0e324f24cd112 React-nativeconfig: d7af5bae6da70fa15ce44f045621cf99ed24087c React-NativeModulesApple: 0123905d5699853ac68519607555a9a4f5c7b3ac React-perflogger: 8a1e1af5733004bdd91258dcefbde21e0d1faccd diff --git a/package/ios/src/AppleFilamentProxy.h b/package/ios/src/AppleFilamentProxy.h index f8863982..c735ff00 100644 --- a/package/ios/src/AppleFilamentProxy.h +++ b/package/ios/src/AppleFilamentProxy.h @@ -18,7 +18,7 @@ class AppleFilamentProxy : public FilamentProxy { ~AppleFilamentProxy(); public: - int loadModel(const std::string& path) override; + int loadModel(const std::string path) override; private: jsi::Runtime* _runtime; diff --git a/package/ios/src/AppleFilamentProxy.mm b/package/ios/src/AppleFilamentProxy.mm index e985fec3..75696798 100644 --- a/package/ios/src/AppleFilamentProxy.mm +++ b/package/ios/src/AppleFilamentProxy.mm @@ -17,7 +17,7 @@ // TODO(hanno): cleanup here? } -int AppleFilamentProxy::loadModel(const std::string& path) { +int AppleFilamentProxy::loadModel(const std::string path) { // TODO(hanno): Implement model loading here return 13; } diff --git a/package/react-native-filament.podspec b/package/react-native-filament.podspec index 1020d38b..011d2703 100644 --- a/package/react-native-filament.podspec +++ b/package/react-native-filament.podspec @@ -15,48 +15,60 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/margelo/react-native-filament.git", :tag => "#{s.version}" } s.pod_target_xcconfig = { + 'GCC_PREPROCESSOR_DEFINITIONS' => 'FILAMENT_APP_USE_METAL=1 $(inherited)', 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17', - "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/cpp/**\" \"$(PODS_TARGET_SRCROOT)/ios/libs/filament/include/**\"" + "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/cpp/**\"" } +s.subspec "filament" do |ss| + ss.source_files = + "ios/libs/filament/include/filament/*.h", + "ios/libs/filament/include/backend/*.h", + "ios/libs/filament/include/filament/MaterialChunkType.h", + "ios/libs/filament/include/filament/MaterialEnums.h", + "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.dependency "react-native-filament/utils" + ss.dependency "react-native-filament/math" +end + +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.dependency "react-native-filament/tsl" +end + +s.subspec "tsl" do |ss| + ss.source_files = "ios/libs/filament/include/tsl/*.h" + ss.header_dir = "tsl" +end + +s.subspec "math" do |ss| + ss.source_files = "ios/libs/filament/include/math/*.h" + ss.header_dir = "math" +end + # All source files that should be publicly visible # Note how this does not include headers, since those can nameclash. s.source_files = [ + "cpp/**/*.{h,c,cpp}", "ios/src/**/*.{h,m,mm}", - "cpp/**/*.{h,hpp,c,cpp}" ] # Any private headers that are not globally unique should be mentioned here. # Otherwise there will be a nameclash, since CocoaPods flattens out any header directories # See https://github.com/firebase/firebase-ios-sdk/issues/4035 for more details. s.preserve_paths = [ - "cpp/**/*.h", - "ios/src/**/*.h" - ] - - # Link all libraries: - s.ios.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", - "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", - "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", - "ios/libs/filament/lib/universal/libfilameshio.a", - "ios/libs/filament/lib/universal/libmeshoptimizer.a", - "ios/libs/filament/lib/universal/libktxreader.a", - "ios/libs/filament/lib/universal/libbasis_transcoder.a", - "ios/libs/filament/lib/universal/libviewer.a", - "ios/libs/filament/lib/universal/libcivetweb.a", - "ios/libs/filament/lib/universal/libuberzlib.a", - "ios/libs/filament/lib/universal/libzstd.a" + # "cpp/**/*.h", + # "ios/src/**/*.h", ] # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.