From c396bc7c6af28b54f9329783f99c2c7a3bef00ce Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Mon, 22 May 2023 09:07:11 -0700 Subject: [PATCH] Add -Wno-error=cpp on App's default Cmake file (#37516) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37516 This will fail build failures from apps which are using libraries which imports ``` #include ``` That's just a warning but our usage of `-Wall -Werror` is causing this to fail user builds. More context on this issue here: https://github.com/reactwg/react-native-releases/discussions/54#discussioncomment-5968545 We can revert this `-Wno-error` once we're on 0.73 as that specific #warning will be entirely removed from the codebase. Changelog: [Internal] [Changed] - Add -Wno-error=cpp on App's default Cmake file Reviewed By: dmytrorykun Differential Revision: D46071400 fbshipit-source-id: 4937fb1255df3f2765f645dfd59f5c58526dee42 --- .../cmake-utils/ReactNative-application.cmake | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake b/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake index 77baf6f4edfdeb..2cb77c4f77d49f 100644 --- a/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake +++ b/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake @@ -46,7 +46,20 @@ target_include_directories(${CMAKE_PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_BUILD_DIR}/generated/rncli/src/main/jni) -target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall -Werror -fexceptions -frtti -std=c++17 -DWITH_INSPECTOR=1 -DLOG_TAG=\"ReactNative\") +target_compile_options(${CMAKE_PROJECT_NAME} + PRIVATE + -Wall + -Werror + # We suppress cpp #error and #warning to don't fail the build + # due to use migrating away from + # #include + # This can be removed for React Native 0.73 + -Wno-error=cpp + -fexceptions + -frtti + -std=c++17 + -DWITH_INSPECTOR=1 + -DLOG_TAG=\"ReactNative\") # Prefab packages from React Native find_package(ReactAndroid REQUIRED CONFIG)