Skip to content

Commit c2e4ae3

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Add support for C++17 in OSS
Summary: changelog: Add support for C++17 Reviewed By: cortinico Differential Revision: D34612257 fbshipit-source-id: 88a0307a750f2e0793a639b7a2b670a4571332fe
1 parent 4eef075 commit c2e4ae3

File tree

25 files changed

+45
-44
lines changed

25 files changed

+45
-44
lines changed

Libraries/Blob/React-RCTBlob.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Pod::Spec.new do |s|
3434
s.header_dir = "RCTBlob"
3535
s.pod_target_xcconfig = {
3636
"USE_HEADERMAP" => "YES",
37-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
37+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
3838
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
3939
}
4040

Libraries/Image/React-RCTImage.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Pod::Spec.new do |s|
3535
s.header_dir = "RCTImage"
3636
s.pod_target_xcconfig = {
3737
"USE_HEADERMAP" => "YES",
38-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
38+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
3939
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
4040
}
4141

Libraries/LinkingIOS/React-RCTLinking.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Pod::Spec.new do |s|
3535
s.header_dir = "RCTLinking"
3636
s.pod_target_xcconfig = {
3737
"USE_HEADERMAP" => "YES",
38-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
38+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
3939
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
4040
}
4141

Libraries/NativeAnimation/React-RCTAnimation.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Pod::Spec.new do |s|
3434
s.header_dir = "RCTAnimation"
3535
s.pod_target_xcconfig = {
3636
"USE_HEADERMAP" => "YES",
37-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
37+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
3838
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
3939
}
4040

Libraries/Network/React-RCTNetwork.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Pod::Spec.new do |s|
3434
s.header_dir = "RCTNetwork"
3535
s.pod_target_xcconfig = {
3636
"USE_HEADERMAP" => "YES",
37-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
37+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
3838
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
3939
}
4040
s.frameworks = "MobileCoreServices"

Libraries/PushNotificationIOS/React-RCTPushNotification.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Pod::Spec.new do |s|
3535
s.header_dir = "RCTPushNotification"
3636
s.pod_target_xcconfig = {
3737
"USE_HEADERMAP" => "YES",
38-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
38+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
3939
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
4040
}
4141
s.framework = "UserNotifications"

Libraries/Settings/React-RCTSettings.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Pod::Spec.new do |s|
3535
s.header_dir = "RCTSettings"
3636
s.pod_target_xcconfig = {
3737
"USE_HEADERMAP" => "YES",
38-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
38+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
3939
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
4040
}
4141

Libraries/TypeSafety/RCTTypeSafety.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Pod::Spec.new do |s|
3333
s.header_dir = "RCTTypeSafety"
3434
s.pod_target_xcconfig = {
3535
"USE_HEADERMAP" => "YES",
36-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
36+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
3737
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/Libraries/TypeSafety\" \"$(PODS_ROOT)/RCT-Folly\""
3838
}
3939

Libraries/Vibration/React-RCTVibration.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Pod::Spec.new do |s|
3535
s.header_dir = "RCTVibration"
3636
s.pod_target_xcconfig = {
3737
"USE_HEADERMAP" => "YES",
38-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
38+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
3939
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
4040
}
4141
s.frameworks = "AudioToolbox"

React/CoreModules/React-CoreModules.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Pod::Spec.new do |s|
3333
s.header_dir = "CoreModules"
3434
s.pod_target_xcconfig = {
3535
"USE_HEADERMAP" => "YES",
36-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
36+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
3737
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/React/CoreModules\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
3838
}
3939

React/FBReactNativeSpec/FBReactNativeSpec.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Pod::Spec.new do |s|
3838

3939
s.pod_target_xcconfig = {
4040
"USE_HEADERMAP" => "YES",
41-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
41+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
4242
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\""
4343
}
4444

React/React-RCTFabric.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
3737
s.header_dir = "React"
3838
s.framework = "JavaScriptCore"
3939
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Public/React-Codegen\"" }
40-
s.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\"",
40+
s.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\"", "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
4141
"OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED" + " " + folly_flags }
4242

4343
s.dependency "React-Core", version

ReactAndroid/src/main/jni/Application.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ NDK_MODULE_PATH := $(APP_MK_DIR)$(HOST_DIRSEP)$(THIRD_PARTY_NDK_DIR)$(HOST_DIRSE
2727
APP_STL := c++_shared
2828

2929
APP_CFLAGS := -Wall -Werror -fexceptions -frtti -DWITH_INSPECTOR=1
30-
APP_CPPFLAGS := -std=c++1y
30+
APP_CPPFLAGS := -std=c++17
3131
# Make sure every shared lib includes a .note.gnu.build-id header
3232
APP_LDFLAGS := -Wl,--build-id
3333

ReactAndroid/src/main/jni/first-party/fb/BUCK

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ oss_cxx_library(
1919
"-fexceptions",
2020
"-Wall",
2121
"-Werror",
22-
"-std=c++14",
22+
"-std=c++17",
2323
"-DDISABLE_CPUCAP",
2424
"-DDISABLE_XPLAT",
2525
],

ReactAndroid/src/main/jni/react/jni/Android.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)
2222
# ./../ == react
2323
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../..
2424

25-
LOCAL_CFLAGS += -fexceptions -frtti -Wno-unused-lambda-capture
25+
LOCAL_CFLAGS += -fexceptions -frtti -Wno-unused-lambda-capture -std=c++17
2626

2727
LOCAL_LDLIBS += -landroid
2828

@@ -79,7 +79,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)
7979
# ./../ == react
8080
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../..
8181

82-
LOCAL_CFLAGS += -fexceptions -frtti -Wno-unused-lambda-capture
82+
LOCAL_CFLAGS += -fexceptions -frtti -Wno-unused-lambda-capture -std=c++17
8383

8484
LOCAL_LDLIBS += -landroid
8585

ReactCommon/ReactCommon.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Pod::Spec.new do |s|
3434
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
3535
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\"",
3636
"USE_HEADERMAP" => "YES",
37-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14" }
37+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }
3838

3939
# TODO (T48588859): Restructure this target to align with dir structure: "react/nativemodule/..."
4040
# Note: Update this only when ready to minimize breaking changes.

ReactCommon/cxxreact/tests/BUCK

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jni_instrumentation_test_lib(
2020
compiler_flags = [
2121
"-fexceptions",
2222
"-frtti",
23-
"-std=c++14",
23+
"-std=c++17",
2424
],
2525
soname = "libxplat-bridge.so",
2626
visibility = [

ReactCommon/microprofiler/BUCK

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cxx_library(
1212
compiler_flags = [
1313
"-Wall",
1414
"-Werror",
15-
"-std=c++14",
15+
"-std=c++17",
1616
"-fexceptions",
1717
"-fno-data-sections",
1818
],

ReactCommon/yoga/Yoga.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Pod::Spec.new do |spec|
3838
'-fexceptions',
3939
'-Wall',
4040
'-Werror',
41-
'-std=c++1y',
41+
'-std=c++17',
4242
'-fPIC'
4343
]
4444

packages/react-native-codegen/DEFS.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def rn_codegen_components(
454454
compiler_flags = [
455455
"-fexceptions",
456456
"-frtti",
457-
"-std=c++14",
457+
"-std=c++17",
458458
"-Wall",
459459
],
460460
contacts = ["[email protected]"],

packages/rn-tester/NativeComponentExample/MyNativeView.podspec

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ Pod::Spec.new do |s|
2424
s.author = "Facebook, Inc. and its affiliates"
2525
s.source = { :git => "https://github.com/facebook/my-native-view.git", :tag => "#{s.version}" }
2626
s.pod_target_xcconfig = {
27-
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/boost\""
27+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/boost\"",
28+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
2829
}
2930

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

packages/rn-tester/Podfile.lock

+18-18
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ SPEC CHECKSUMS:
884884
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
885885
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
886886
FBLazyVector: b81a2b70c72d8b0aefb652cea22c11e9ffd02949
887-
FBReactNativeSpec: 35cca37e6328d64b4e38c4adb1a28db74b60aeac
887+
FBReactNativeSpec: 04dbf2a5d787706cace2f2af8ff3790333b761cd
888888
Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0
889889
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
890890
Flipper-DoubleConversion: 57ffbe81ef95306cc9e69c4aa3aeeeeb58a6a28c
@@ -898,14 +898,14 @@ SPEC CHECKSUMS:
898898
glog: 476ee3e89abb49e07f822b48323c51c57124b572
899899
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
900900
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
901-
RCT-Folly: 803a9cfd78114b2ec0f140cfa6fa2a6bafb2d685
901+
RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8
902902
RCTRequired: af2d6080a4b9ba0885b28ca78879a92066c71cab
903-
RCTTypeSafety: c7a7f67ae5b1b986b78d817baa408fc984ab7c0c
903+
RCTTypeSafety: 2d6c5149fd3b8f2ba89987b47169423efb740300
904904
React: f64c9f6db5428717922a3292ba6a448615a2e143
905905
React-callinvoker: c5d61e29df57793f0dc10ec2bc01c846f863e51f
906-
React-Codegen: 2256e335ccce7326eeca6d7a668e05c4de259289
906+
React-Codegen: c4ae835565487e494740b756ce953d8f635a76df
907907
React-Core: 30784d0eacbd709a3a6a5ae7c02c928634a6247e
908-
React-CoreModules: a8e2bdc1ebbf8d440478456197abd58d1691f61a
908+
React-CoreModules: e784fdac1d0293963fc06646aa76cfdcd906a754
909909
React-cxxreact: cfc1663dae1ea52b465bbf021ef7b1527c5dc80c
910910
React-Fabric: 30b8fa96a0c56d1c11348f77607464eb87bb3f9f
911911
React-graphics: 9a84942b49ea1375ce83844041fa2ba766cfe0b9
@@ -915,21 +915,21 @@ SPEC CHECKSUMS:
915915
React-logger: 2009c0280c286a76200d6b7c5fe242fad51ddd7a
916916
React-perflogger: fe66bd6d8b17ebcfdf0159bf41fe28d8035ac20c
917917
React-RCTActionSheet: 3131a0b9280aa0e51bdf54b3d79aecd8503db62c
918-
React-RCTAnimation: 0c0a35cd27c5005cfddcda59b612994f4ebdaa43
919-
React-RCTBlob: 48cae62d905ef96ab10c84ab16163643a3c872a7
920-
React-RCTFabric: c126a269f6279896e19e133d6b1e019fa2f0f028
921-
React-RCTImage: 2ce3f1f72de91798eb31c9001b30cab8d1c71c4e
922-
React-RCTLinking: 77300bd3cda2a613845ae0056b62ad330c2d319d
923-
React-RCTNetwork: 8ef793740f893987384918e04382d37fac36960d
924-
React-RCTPushNotification: 1845de920c2583f4541e13b3e9bd20a2ba896ffa
925-
React-RCTSettings: 2beadc19336aa83a49e9ee9f704157c64799e840
926-
React-RCTTest: 12bbd7fc2e72bd9920dc7286c5b8ef96639582b6
918+
React-RCTAnimation: 218e2557f9803c1d8b4fd814b6c54b223ee18cda
919+
React-RCTBlob: f94c621fa9851a5f81da471016ce5d91d29b2c7f
920+
React-RCTFabric: 134127990b95158033ff22db25f5474d4aeecc96
921+
React-RCTImage: 996407b090e9fa8bb2213b6887676b1541052cb5
922+
React-RCTLinking: 6fcb5735f35935e0e53dc45e97f77234d7920232
923+
React-RCTNetwork: 2d51ae6d31c26bbcaab9abd56e523f8010cc57ae
924+
React-RCTPushNotification: c5dfa4ab4da2b5312223334a55b30527218197d4
925+
React-RCTSettings: 9f897f32b7c4d0bc9a2718b7cb7d4f193889f5e3
926+
React-RCTTest: 7cbcd615b1e74ad59c9ad4257e6c323482114173
927927
React-RCTText: e9146b2c0550a83d1335bfe2553760070a2d75c7
928-
React-RCTVibration: 50be9c390f2da76045ef0dfdefa18b9cf9f35cfa
929-
React-rncore: d292b6c2196dcd555622a538e1b206aa2e0ad8a2
928+
React-RCTVibration: 9a73a3550a0ee184530341f91f9b85ad9cf3465a
929+
React-rncore: 69bf49af24eafcd61f1e352c0cbff5cf17e70ed4
930930
React-runtimeexecutor: 4b0c6eb341c7d3ceb5e2385cb0fdb9bf701024f3
931-
ReactCommon: 7a2714d1128f965392b6f99a8b390e3aa38c9569
932-
ScreenshotManager: e8da2e62b3c08a87cece436776ce91555ecec77c
931+
ReactCommon: 9607f2246289d573adcbd144c02c19ae5246d6a5
932+
ScreenshotManager: 2e9d0bca1461f67405d21ca06a609cb844c3fb3c
933933
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
934934
Yoga: c0d06f5380d34e939f55420669a60fe08b79bd75
935935
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

packages/rn-tester/RCTTest/React-RCTTest.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Pod::Spec.new do |s|
3535
s.header_dir = "RCTTest"
3636
s.pod_target_xcconfig = {
3737
"USE_HEADERMAP" => "YES",
38-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
38+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
3939
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\""
4040
}
4141

packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@
841841
buildSettings = {
842842
ALWAYS_SEARCH_USER_PATHS = NO;
843843
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
844-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
844+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
845845
CLANG_CXX_LIBRARY = "libc++";
846846
CLANG_ENABLE_MODULES = YES;
847847
CLANG_ENABLE_OBJC_ARC = YES;
@@ -925,7 +925,7 @@
925925
buildSettings = {
926926
ALWAYS_SEARCH_USER_PATHS = NO;
927927
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
928-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
928+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
929929
CLANG_CXX_LIBRARY = "libc++";
930930
CLANG_ENABLE_MODULES = YES;
931931
CLANG_ENABLE_OBJC_ARC = YES;

scripts/react_native_pods.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def get_react_codegen_spec(options={})
355355
'homepage' => 'https://facebook.com/',
356356
'license' => 'Unlicense',
357357
'authors' => 'Facebook',
358-
'compiler_flags' => "#{folly_compiler_flags} #{boost_compiler_flags} -Wno-nullability-completeness",
358+
'compiler_flags' => "#{folly_compiler_flags} #{boost_compiler_flags} -Wno-nullability-completeness -std=c++17",
359359
'source' => { :git => '' },
360360
'header_mappings_dir' => './',
361361
'platforms' => {

0 commit comments

Comments
 (0)