Skip to content

Commit

Permalink
Enable -Wpedantic in OSS Android Targets (facebook#34403)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#34403

This change mirrors D38457812 (facebook@063c2b4) which added -Wpedantic to ReactCommon targets, but for the Android build used by OSS. This should ensure contributors see the same warnings locally as the internal build would produce.

Changelog:
[Android][Changed] - Enable -Wpedantic in OSS Android Targets

Reviewed By: cortinico

Differential Revision: D38632454

fbshipit-source-id: 19a036ee3f902eb9d47c568aef448af9d8562358
  • Loading branch information
NickGerleman authored and roryabraham committed Aug 17, 2022
1 parent 0d55ccf commit cc77ac7
Show file tree
Hide file tree
Showing 39 changed files with 279 additions and 35 deletions.
4 changes: 3 additions & 1 deletion ReactCommon/butter/CMakeLists.txt
Expand Up @@ -11,7 +11,9 @@ add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall)
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments)

add_library(butter INTERFACE)

Expand Down
8 changes: 7 additions & 1 deletion ReactCommon/callinvoker/CMakeLists.txt
Expand Up @@ -6,7 +6,13 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall)
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments)

add_library(callinvoker INTERFACE)

Expand Down
9 changes: 8 additions & 1 deletion ReactCommon/react/bridging/CMakeLists.txt
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"ReactNative\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"ReactNative\")

file(GLOB react_bridging_SRC CONFIGURE_DEPENDS *.cpp)

Expand Down
2 changes: 2 additions & 0 deletions ReactCommon/react/config/CMakeLists.txt
Expand Up @@ -11,6 +11,8 @@ add_compile_options(
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB react_config_SRC CONFIGURE_DEPENDS *.cpp)
Expand Down
2 changes: 2 additions & 0 deletions ReactCommon/react/debug/CMakeLists.txt
Expand Up @@ -11,6 +11,8 @@ add_compile_options(
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")


Expand Down
9 changes: 8 additions & 1 deletion ReactCommon/react/nativemodule/core/CMakeLists.txt
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"ReactNative\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"ReactNative\")


file(GLOB react_nativemodule_core_SRC CONFIGURE_DEPENDS
Expand Down
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"ReactNative\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"ReactNative\")

file(GLOB sampleturbomodule_SRC CONFIGURE_DEPENDS ReactCommon/*.cpp)
add_library(sampleturbomodule STATIC ${sampleturbomodule_SRC})
Expand Down
9 changes: 8 additions & 1 deletion ReactCommon/react/renderer/animations/CMakeLists.txt
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB react_render_animations_SRC CONFIGURE_DEPENDS *.cpp)
add_library(react_render_animations SHARED ${react_render_animations_SRC})
Expand Down
9 changes: 8 additions & 1 deletion ReactCommon/react/renderer/attributedstring/CMakeLists.txt
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB react_render_attributedstring_SRC CONFIGURE_DEPENDS *.cpp)
add_library(react_render_attributedstring SHARED ${react_render_attributedstring_SRC})
Expand Down
9 changes: 8 additions & 1 deletion ReactCommon/react/renderer/componentregistry/CMakeLists.txt
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB react_render_componentregistry_SRC CONFIGURE_DEPENDS *.cpp)
add_library(react_render_componentregistry SHARED ${react_render_componentregistry_SRC})
Expand Down
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB rrc_native_SRC CONFIGURE_DEPENDS *.cpp)
add_library(rrc_native SHARED ${rrc_native_SRC})
Expand Down
9 changes: 8 additions & 1 deletion ReactCommon/react/renderer/components/image/CMakeLists.txt
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB rrc_image_SRC CONFIGURE_DEPENDS *.cpp)
add_library(rrc_image SHARED ${rrc_image_SRC})
Expand Down
9 changes: 8 additions & 1 deletion ReactCommon/react/renderer/components/modal/CMakeLists.txt
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB rrc_modal_SRC CONFIGURE_DEPENDS *.cpp)
add_library(rrc_modal STATIC ${rrc_modal_SRC})
Expand Down
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB rrc_progressbar_SRC CONFIGURE_DEPENDS android/react/renderer/components/progressbar/*.cpp)
add_library(rrc_progressbar STATIC ${rrc_progressbar_SRC})
Expand Down
9 changes: 8 additions & 1 deletion ReactCommon/react/renderer/components/root/CMakeLists.txt
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB rrc_root_SRC CONFIGURE_DEPENDS *.cpp)
add_library(rrc_root SHARED ${rrc_root_SRC})
Expand Down
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB rrc_scrollview_SRC CONFIGURE_DEPENDS *.cpp)
add_library(rrc_scrollview SHARED ${rrc_scrollview_SRC})
Expand Down
9 changes: 8 additions & 1 deletion ReactCommon/react/renderer/components/slider/CMakeLists.txt
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB rrc_slider_SRC CONFIGURE_DEPENDS *.cpp platform/android/react/renderer/components/slider/*.cpp)
add_library(rrc_slider STATIC ${rrc_slider_SRC})
Expand Down
2 changes: 2 additions & 0 deletions ReactCommon/react/renderer/components/switch/CMakeLists.txt
Expand Up @@ -41,4 +41,6 @@ target_compile_options(
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
)
9 changes: 8 additions & 1 deletion ReactCommon/react/renderer/components/text/CMakeLists.txt
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB rrc_text_SRC CONFIGURE_DEPENDS *.cpp)
add_library(rrc_text SHARED ${rrc_text_SRC})
Expand Down
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB rrc_textinput_SRC CONFIGURE_DEPENDS androidtextinput/react/renderer/components/androidtextinput/*.cpp)
add_library(rrc_textinput SHARED ${rrc_textinput_SRC})
Expand Down
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB rrc_unimplementedview_SRC CONFIGURE_DEPENDS *.cpp)
add_library(rrc_unimplementedview SHARED ${rrc_unimplementedview_SRC})
Expand Down
9 changes: 8 additions & 1 deletion ReactCommon/react/renderer/components/view/CMakeLists.txt
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB rrc_view_SRC CONFIGURE_DEPENDS *.cpp)
add_library(rrc_view SHARED ${rrc_view_SRC})
Expand Down
9 changes: 8 additions & 1 deletion ReactCommon/react/renderer/core/CMakeLists.txt
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB react_render_core_SRC CONFIGURE_DEPENDS *.cpp)
add_library(react_render_core SHARED ${react_render_core_SRC})
Expand Down
9 changes: 8 additions & 1 deletion ReactCommon/react/renderer/debug/CMakeLists.txt
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB react_render_debug_SRC CONFIGURE_DEPENDS *.cpp)
add_library(react_render_debug SHARED ${react_render_debug_SRC})
Expand Down
9 changes: 8 additions & 1 deletion ReactCommon/react/renderer/graphics/CMakeLists.txt
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB react_render_graphics_SRC CONFIGURE_DEPENDS
*.cpp
Expand Down
9 changes: 8 additions & 1 deletion ReactCommon/react/renderer/imagemanager/CMakeLists.txt
Expand Up @@ -6,7 +6,14 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\")
add_compile_options(
-fexceptions
-frtti
-std=c++17
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
-DLOG_TAG=\"Fabric\")

file(GLOB react_render_imagemanager_SRC CONFIGURE_DEPENDS
*.cpp
Expand Down

0 comments on commit cc77ac7

Please sign in to comment.