From 5ea0b449e246257feddcd7ca6cf6c551e9c5ab76 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 15 Sep 2023 02:47:07 -0700 Subject: [PATCH] Fix podspecs building with C++ 14 (#39464) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39464 We currently have 854 warnings emitted due to nested namespaces being a C++ 17 extension lol. This sets the standard explicitly to C++ 20 in the specs emitting the warnings (mostly RCT-Text). It is undesirable that we add hundreds of warnings to the CocoaPods build without signal. Our Buck build and OSS Android build both treat warnings as errors. But... that is for another day. Changelog: [Intenrnal] Reviewed By: cortinico Differential Revision: D49303081 fbshipit-source-id: 1233e9d51426fb8dbd8ca39a771e2fef3d0df856 --- packages/react-native/Libraries/Text/React-RCTText.podspec | 1 + packages/react-native/ReactCommon/React-nativeconfig.podspec | 1 + .../ReactCommon/react/renderer/graphics/React-graphics.podspec | 3 ++- .../ReactCommon/reactperflogger/React-perflogger.podspec | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/Text/React-RCTText.podspec b/packages/react-native/Libraries/Text/React-RCTText.podspec index 0ebd0378dbb..5ef1aab04f3 100644 --- a/packages/react-native/Libraries/Text/React-RCTText.podspec +++ b/packages/react-native/Libraries/Text/React-RCTText.podspec @@ -30,6 +30,7 @@ Pod::Spec.new do |s| s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs" s.header_dir = "RCTText" s.framework = ["MobileCoreServices"] + s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++20" } s.dependency "Yoga" s.dependency "React-Core/RCTTextHeaders", version diff --git a/packages/react-native/ReactCommon/React-nativeconfig.podspec b/packages/react-native/ReactCommon/React-nativeconfig.podspec index 7da46233264..afce6e165ca 100644 --- a/packages/react-native/ReactCommon/React-nativeconfig.podspec +++ b/packages/react-native/ReactCommon/React-nativeconfig.podspec @@ -27,6 +27,7 @@ Pod::Spec.new do |s| s.source = source s.source_files = "react/config/*.{m,mm,cpp,h}" s.header_dir = "react/config" + s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++20" } if ENV['USE_FRAMEWORKS'] s.header_mappings_dir = './' diff --git a/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec b/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec index 848a439774a..4f10e5c6a7f 100644 --- a/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec +++ b/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec @@ -51,7 +51,8 @@ Pod::Spec.new do |s| s.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", "HEADER_SEARCH_PATHS" => header_search_paths.join(" "), - "DEFINES_MODULE" => "YES" } + "DEFINES_MODULE" => "YES", + "CLANG_CXX_LANGUAGE_STANDARD" => "c++20" } s.dependency "glog" s.dependency "RCT-Folly/Fabric", folly_version diff --git a/packages/react-native/ReactCommon/reactperflogger/React-perflogger.podspec b/packages/react-native/ReactCommon/reactperflogger/React-perflogger.podspec index 6a08348184a..b359eb2fdbc 100644 --- a/packages/react-native/ReactCommon/reactperflogger/React-perflogger.podspec +++ b/packages/react-native/ReactCommon/reactperflogger/React-perflogger.podspec @@ -31,4 +31,5 @@ Pod::Spec.new do |s| s.source = source s.source_files = "**/*.{cpp,h}" s.header_dir = "reactperflogger" + s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++20" } end