From 62d4768984ca5c447c114bb641bf1153d82aa646 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Fri, 13 Sep 2024 08:19:55 -0700 Subject: [PATCH] Inhibit warning in 3p libraries (#46464) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46464 React Native uses some 3P libraries that are emitting some warnings for which we can't do anything about. This change suppress those warnings. ## Changelog: [Internal] - Suppress 3p warnings Reviewed By: cortinico Differential Revision: D62582960 fbshipit-source-id: 79e8c28725177f5f47359da86f865e770dcf7c7b --- .../react-native/sdks/hermes-engine/hermes-engine.podspec | 3 ++- .../third-party-podspecs/DoubleConversion.podspec | 1 + packages/react-native/third-party-podspecs/RCT-Folly.podspec | 3 ++- packages/react-native/third-party-podspecs/boost.podspec | 4 ++++ packages/react-native/third-party-podspecs/fmt.podspec | 1 + packages/react-native/third-party-podspecs/glog.podspec | 3 ++- 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec index 6680c60dc49..787b55c3fc8 100644 --- a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec +++ b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec @@ -36,7 +36,8 @@ Pod::Spec.new do |spec| spec.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", - "CLANG_CXX_LIBRARY" => "compiler-default" + "CLANG_CXX_LIBRARY" => "compiler-default", + "GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES" # Disable warnings because we don't control this library } spec.ios.vendored_frameworks = "destroot/Library/Frameworks/ios/hermes.framework" diff --git a/packages/react-native/third-party-podspecs/DoubleConversion.podspec b/packages/react-native/third-party-podspecs/DoubleConversion.podspec index 36e675464e7..56923bcab13 100644 --- a/packages/react-native/third-party-podspecs/DoubleConversion.podspec +++ b/packages/react-native/third-party-podspecs/DoubleConversion.podspec @@ -25,6 +25,7 @@ Pod::Spec.new do |spec| spec.pod_target_xcconfig = { "DEFINES_MODULE" => "YES", + "GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES" # Disable warnings because we don't control this library } # Pinning to the same version as React.podspec. diff --git a/packages/react-native/third-party-podspecs/RCT-Folly.podspec b/packages/react-native/third-party-podspecs/RCT-Folly.podspec index 0f79c326b9b..40226c863cf 100644 --- a/packages/react-native/third-party-podspecs/RCT-Folly.podspec +++ b/packages/react-native/third-party-podspecs/RCT-Folly.podspec @@ -86,7 +86,8 @@ Pod::Spec.new do |spec| "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(), "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"", # In dynamic framework (use_frameworks!) mode, ignore the unused and undefined boost symbols when generating the library. - "OTHER_LDFLAGS" => "\"-Wl,-U,_jump_fcontext\" \"-Wl,-U,_make_fcontext\"" + "OTHER_LDFLAGS" => "\"-Wl,-U,_jump_fcontext\" \"-Wl,-U,_make_fcontext\"", + "GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES" # Disable warnings because we don't control this library } # TODO: The boost spec should really be selecting these files so that dependents of Folly can also access the required headers. diff --git a/packages/react-native/third-party-podspecs/boost.podspec b/packages/react-native/third-party-podspecs/boost.podspec index 585af409718..e30a2305df8 100644 --- a/packages/react-native/third-party-podspecs/boost.podspec +++ b/packages/react-native/third-party-podspecs/boost.podspec @@ -27,4 +27,8 @@ Pod::Spec.new do |spec| spec.header_mappings_dir = 'boost/boost' spec.resource_bundles = {'boost_privacy' => 'boost/PrivacyInfo.xcprivacy'} + + spec.pod_target_xcconfig = { + "GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES" # Disable warnings because we don't control this library + } end diff --git a/packages/react-native/third-party-podspecs/fmt.podspec b/packages/react-native/third-party-podspecs/fmt.podspec index cdfd5269f9a..c76b312e6b6 100644 --- a/packages/react-native/third-party-podspecs/fmt.podspec +++ b/packages/react-native/third-party-podspecs/fmt.podspec @@ -19,6 +19,7 @@ Pod::Spec.new do |spec| } spec.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(), + "GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES" # Disable warnings because we don't control this library } spec.platforms = min_supported_versions spec.libraries = "c++" diff --git a/packages/react-native/third-party-podspecs/glog.podspec b/packages/react-native/third-party-podspecs/glog.podspec index 04857067c60..af7668077f9 100644 --- a/packages/react-native/third-party-podspecs/glog.podspec +++ b/packages/react-native/third-party-podspecs/glog.podspec @@ -37,7 +37,8 @@ Pod::Spec.new do |spec| spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", "HEADER_SEARCH_PATHS" => "$(PODS_TARGET_SRCROOT)/src", - "DEFINES_MODULE" => "YES" + "DEFINES_MODULE" => "YES", + "GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES" # Disable warnings because we don't control this library } # Pinning to the same version as React.podspec.