Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions react-native-apple-llm.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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"
Expand Down