diff --git a/react-native-apple-llm.podspec b/react-native-apple-llm.podspec index 5c1de01..6081336 100644 --- a/react-native-apple-llm.podspec +++ b/react-native-apple-llm.podspec @@ -2,13 +2,14 @@ require 'json' package = JSON.parse(File.read(File.join(__dir__, "package.json"))) folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' +use_rn_dep = ENV['RCT_USE_RN_DEP'] == '1' Pod::Spec.new do |s| s.name = package["name"] s.version = package['version'] s.summary = package["description"] s.homepage = "https://github.com/deveix/react-native-apple-llm" - s.license = { :type => package["license"], :file => "LICENSE" } + s.license = { :type => package["license"], :file => "LICENSE.md" } s.authors = { package["author"]["name"] => package["author"]["email"] } s.ios.deployment_target = '13.0' @@ -21,15 +22,17 @@ Pod::Spec.new do |s| # Don't install the dependencies when we run `pod install` in the old architecture. if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then - s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1" + new_arch_flags = "-DRCT_NEW_ARCH_ENABLED=1" + s.compiler_flags = use_rn_dep ? new_arch_flags : (folly_compiler_flags + " " + new_arch_flags) s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/React-Core/React\" \"$(PODS_ROOT)/React-Core\"", - "OTHER_CPLUSPLUSFLAGS" => folly_compiler_flags, + # Avoid overriding C++ flags when RN provides prebuilt deps + "OTHER_CPLUSPLUSFLAGS" => use_rn_dep ? "$(inherited)" : folly_compiler_flags, "CLANG_CXX_LANGUAGE_STANDARD" => "c++17", "DEFINES_MODULE" => "YES", } s.dependency "React-Codegen" - s.dependency "RCT-Folly" + s.dependency "RCT-Folly" unless use_rn_dep s.dependency "RCTRequired" s.dependency "RCTTypeSafety" s.dependency "ReactCommon/turbomodule/core"