Skip to content

Commit 8dee28a

Browse files
authored
fix(ios): Use install_modules_dependencies in the podspec (#796)
1 parent 276101d commit 8dee28a

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

react-native-pager-view.podspec

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,27 @@ Pod::Spec.new do |s|
1616

1717
s.source_files = "ios/**/*.{h,m,mm}"
1818

19-
s.dependency "React-Core"
19+
# install_modules_dependencies has been defined in RN 0.70
20+
# This check ensure that the library can work on older versions of RN
21+
if defined?(install_modules_dependencies)
22+
install_modules_dependencies(s)
23+
else
24+
s.dependency "React-Core"
2025

21-
# Don't install the dependencies when we run `pod install` in the old architecture.
22-
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
23-
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
24-
s.pod_target_xcconfig = {
26+
# Don't install the dependencies when we run `pod install` in the old architecture.
27+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
28+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
29+
s.pod_target_xcconfig = {
2530
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
2631
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
2732
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
28-
}
29-
s.dependency "React-Codegen"
30-
s.dependency "RCT-Folly"
31-
s.dependency "RCTRequired"
32-
s.dependency "RCTTypeSafety"
33-
s.dependency "ReactCommon/turbomodule/core"
34-
s.dependency "React-RCTFabric"
33+
}
34+
s.dependency "React-Codegen"
35+
s.dependency "RCT-Folly"
36+
s.dependency "RCTRequired"
37+
s.dependency "RCTTypeSafety"
38+
s.dependency "ReactCommon/turbomodule/core"
39+
s.dependency "React-RCTFabric"
40+
end
3541
end
3642
end

0 commit comments

Comments
 (0)