Skip to content

Commit

Permalink
fix(ios): add new arch flag to swift (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
lodev09 authored Feb 26, 2025
1 parent ce38492 commit 717de68
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ PODS:
- React-Core
- react-native-safe-area-context (5.2.0):
- React-Core
- react-native-true-sheet (2.0.1):
- react-native-true-sheet (2.0.2):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1923,7 +1923,7 @@ SPEC CHECKSUMS:
React-microtasksnativemodule: 72564d5469003687d39bfc4efad281df8efc0684
react-native-maps: ee1e65647460c3d41e778071be5eda10e3da6225
react-native-safe-area-context: 849d7df29ecb2a7155c769c0b76849ba952c2aa3
react-native-true-sheet: e0f2b8f0ef57709f15474aed2527ad63975e3843
react-native-true-sheet: 7fb131224336979607e4d81c523e07f618ae3a71
React-nativeconfig: cb207ebba7cafce30657c7ad9f1587a8f32e4564
React-NativeModulesApple: 82a8bee52df9f5b378195a500f22be3a6ef0f890
React-perflogger: 8152bab3f0eb4b8751f282f9af7caed2c823a9ea
Expand Down
15 changes: 11 additions & 4 deletions react-native-true-sheet.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ Pod::Spec.new do |s|

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

if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
s.pod_target_xcconfig = {
# Detect if new arch is enabled in Swift code
"OTHER_SWIFT_FLAGS" => "-DRCT_NEW_ARCH_ENABLED"
}
end

# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
if respond_to?(:install_modules_dependencies, true)
Expand All @@ -26,10 +33,10 @@ 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"
s.pod_target_xcconfig = {
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
s.pod_target_xcconfig = s.pod_target_xcconfig | {
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
}
s.dependency "React-RCTFabric"
s.dependency "React-Codegen"
Expand Down

0 comments on commit 717de68

Please sign in to comment.