Skip to content

Commit

Permalink
chore: prepare repo for Apple Silicon (#1094)
Browse files Browse the repository at this point in the history
This PR makes sure that example project used to test react-native-screens compile on Apple arm64 chips.
  • Loading branch information
kacperkapusciak authored Sep 7, 2021
1 parent 8e2048e commit afd0b56
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 15 deletions.
9 changes: 9 additions & 0 deletions Example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,14 @@ target 'ScreensExample' do

post_install do |installer|
react_native_post_install(installer)
# Workaround for RN <=0.65. Remove while upgrading to RN 0.66
installer.aggregate_targets.each do |aggregate_target|
aggregate_target.user_project.native_targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(inherited)']
end
end
aggregate_target.user_project.save
end
end
end
4 changes: 2 additions & 2 deletions Example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,6 @@ SPEC CHECKSUMS:
Yoga: aa0cb45287ebe1004c02a13f279c55a95f1572f4
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 33e443669bf55d5d0c5085d73c5e14ff9025260f
PODFILE CHECKSUM: c3d6d5e8a8c0eb604b6b95c52b5d1eae53f4a2e0

COCOAPODS: 1.10.1
COCOAPODS: 1.10.2
36 changes: 34 additions & 2 deletions Example/ios/ScreensExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,10 @@
INFOPLIST_FILE = ScreensExampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
Expand All @@ -576,6 +580,10 @@
INFOPLIST_FILE = ScreensExampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
Expand All @@ -598,6 +606,10 @@
INFOPLIST_FILE = ScreensExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -622,6 +634,10 @@
INFOPLIST_FILE = ScreensExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -649,6 +665,10 @@
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "ScreensExample-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -676,6 +696,10 @@
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "ScreensExample-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -702,6 +726,10 @@
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "ScreensExample-tvOSTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -728,6 +756,10 @@
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "ScreensExample-tvOSTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -773,7 +805,7 @@
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -834,7 +866,7 @@
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down
8 changes: 4 additions & 4 deletions TVOSExample/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ PODS:
- React-RCTText
- ReactCommon/turbomodule/core
- Yoga
- RNScreens (3.5.0):
- RNScreens (3.6.0):
- React-Core
- React-RCTImage
- RNVectorIcons (7.1.0):
Expand Down Expand Up @@ -399,7 +399,7 @@ SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
DoubleConversion: cde416483dac037923206447da6e1454df403714
FBLazyVector: 7fd7485ebdd1572a8faf2a24509ed2c37f8db77f
FBReactNativeSpec: 0246c384e48d1d21330ca7c4738fba6d11f47558
FBReactNativeSpec: 309ac3ca30608fb7bb93967895209d547faa10f9
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c
RCTRequired: 587385d66e6bbb5632ade820568adf71edb60545
Expand Down Expand Up @@ -428,10 +428,10 @@ SPEC CHECKSUMS:
RNCMaskedView: 0e1bc4bfa8365eba5fbbb71e07fbdc0555249489
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
RNReanimated: 2890fc5c407cd71da99851e92bef5a571334b7a4
RNScreens: 01ab149b5dd5c27f5ff26741b1d2bdf2cee1af35
RNScreens: eb0dfb2d6b21d2d7f980ad46b14eb306d2f1062e
RNVectorIcons: bc69e6a278b14842063605de32bec61f0b251a59
Yoga: e6fb09105c0264e3ad22605d6b6fa2776e169518

PODFILE CHECKSUM: 23b6d36f38ea6cbf85cb099bf5918bff31908a56

COCOAPODS: 1.10.1
COCOAPODS: 1.10.2
7 changes: 4 additions & 3 deletions TVOSExample/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const modules = [
'@react-navigation/native',
'react-navigation',
'react-navigation-stack',
'react-native-reanimated',
'react-native-safe-area-context',
...Object.keys(pack.peerDependencies),
];

Expand All @@ -23,9 +25,8 @@ module.exports = {
resolver: {
blacklistRE: blacklist(
modules.map(
(m) =>
new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
)
m => new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`),
),
),

extraNodeModules: modules.reduce((acc, name) => {
Expand Down
9 changes: 9 additions & 0 deletions TestsExample/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,14 @@ target 'TestsExample' do

post_install do |installer|
react_native_post_install(installer)
# Workaround for RN <=0.65. Remove while upgrading to RN 0.66
installer.aggregate_targets.each do |aggregate_target|
aggregate_target.user_project.native_targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(inherited)']
end
end
aggregate_target.user_project.save
end
end
end
4 changes: 2 additions & 2 deletions TestsExample/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,6 @@ SPEC CHECKSUMS:
Yoga: aa0cb45287ebe1004c02a13f279c55a95f1572f4
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: e0d0b9e4340856ccb5802968589d77b420885db5
PODFILE CHECKSUM: c38bab3405476dc3c9e91fe4aa46834c196565d3

COCOAPODS: 1.10.1
COCOAPODS: 1.10.2
36 changes: 34 additions & 2 deletions TestsExample/ios/TestsExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,10 @@
INFOPLIST_FILE = TestsExampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
Expand All @@ -681,6 +685,10 @@
INFOPLIST_FILE = TestsExampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
Expand All @@ -702,6 +710,10 @@
ENABLE_BITCODE = NO;
INFOPLIST_FILE = TestsExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -725,6 +737,10 @@
CURRENT_PROJECT_VERSION = 1;
INFOPLIST_FILE = TestsExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -752,6 +768,10 @@
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "TestsExample-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -779,6 +799,10 @@
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "TestsExample-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -805,6 +829,10 @@
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "TestsExample-tvOSTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -831,6 +859,10 @@
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "TestsExample-tvOSTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -876,7 +908,7 @@
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -937,7 +969,7 @@
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down

0 comments on commit afd0b56

Please sign in to comment.