Skip to content

Commit

Permalink
fix(ios): build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hannojg committed Jan 25, 2024
1 parent 3850942 commit 60965f3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions package/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ android/keystores/debug.keystore

# generated by bob
lib/
libs/

# Skia headers
cpp/skia
Expand Down
2 changes: 1 addition & 1 deletion package/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ SPEC CHECKSUMS:
React-jsinspector: 8baadae51f01d867c3921213a25ab78ab4fbcd91
React-logger: 8edc785c47c8686c7962199a307015e2ce9a0e4f
react-native-skia: 60202ab85d2ea2f90f9e3d70f4dcb00fd589e72e
react-native-skia-skottie: 69f79c001f2beccb9991c40cd684be99d4b45e8f
react-native-skia-skottie: 3b28eefda39685d1bea75d9e3910aef5e505fba5
React-NativeModulesApple: b6868ee904013a7923128892ee4a032498a1024a
React-perflogger: 31ea61077185eb1428baf60c0db6e2886f141a5a
React-RCTActionSheet: 392090a3abc8992eb269ef0eaa561750588fc39d
Expand Down
19 changes: 12 additions & 7 deletions package/react-native-skia-skottie.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,25 @@ Pod::Spec.new do |s|
s.platforms = { :ios => "12.4" }
s.source = { :git => "https://github.com/margelo/react-native-skia-skottie.git", :tag => "#{s.version}" }

# TODO: what does that do, why do we need it?
s.requires_arc = true

s.pod_target_xcconfig = {
"GCC_PREPROCESSOR_DEFINITIONS" => "$(inherited) SK_METAL=1 SK_GANESH=1", # TODO: do i need this?
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/cpp/\"/** \"#{skiaPath}/cpp/**\" "
}

pwd = Pathname.new(Dir.pwd)
relative_skia_path = Pathname.new(skiaPath).relative_path_from(pwd).to_s
# Unfortunately vendored_frameworks doesn't support relative parent paths, or absolute paths.
# So we have to copy the frameworks to a path on the same level as the podspec.
s.prepare_command = <<-CMD
mkdir -p libs/
rm -rf libs/ios
mkdir -p libs/ios
cp -r "#{skiaPath}/libs/ios/libsksg.xcframework" libs/ios/
cp -r "#{skiaPath}/libs/ios/libskottie.xcframework" libs/ios/
CMD

s.ios.vendored_frameworks = [
"#{relative_skia_path}/libs/ios/libsksg.xcframework",
"#{relative_skia_path}/libs/ios/libskottie.xcframework",
"libs/ios/libsksg.xcframework",
"libs/ios/libskottie.xcframework"
]

s.source_files = "ios/**/*.{h,m,mm}", "cpp/**/*.{h,cpp}"
Expand Down

0 comments on commit 60965f3

Please sign in to comment.