Skip to content

Commit 07ea97c

Browse files
NickGerlemanroryabraham
authored andcommitted
Enable pedantic warnings in C++ podspecs (facebook#34404)
Summary: Pull Request resolved: facebook#34404 Mirrors D38457812 (facebook@063c2b4) and D38632454 (facebook@06b55a3), this enables pedantic warnings for iOS in OSS, so that the warning level matches the internal. This is enabled through the `GCC_WARN_PEDANTIC` xcconfig flag (part of "Apple Clang - Warning Policies"), which controls whether "-pedantic" is passed to clang. Changelog: [iOS][Changed] - Enable pedantic warnings in C++ podspecs Reviewed By: cipolleschi Differential Revision: D38681644 fbshipit-source-id: 724160fbe03660fcfd12ea0ffeedaab448c66a5f
1 parent 9c5e465 commit 07ea97c

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

ReactCommon/React-Fabric.podspec

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ else
1616
source[:tag] = "v#{version}"
1717
end
1818

19-
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
19+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-gnu-zero-variadic-macro-arguments'
2020
folly_version = '2021.07.22.00'
2121
folly_dep_name = 'RCT-Folly/Fabric'
2222
boost_compiler_flags = '-Wno-documentation'
@@ -315,7 +315,8 @@ Pod::Spec.new do |s|
315315
ss.source_files = "react/renderer/leakchecker/**/*.{cpp,h}"
316316
ss.exclude_files = "react/renderer/leakchecker/tests"
317317
ss.header_dir = "react/renderer/leakchecker"
318-
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
318+
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"",
319+
"GCC_WARN_PEDANTIC" => "YES" }
319320
end
320321

321322
s.subspec "runtimescheduler" do |ss|
@@ -324,13 +325,14 @@ Pod::Spec.new do |s|
324325
ss.source_files = "react/renderer/runtimescheduler/**/*.{cpp,h}"
325326
ss.exclude_files = "react/renderer/runtimescheduler/tests"
326327
ss.header_dir = "react/renderer/runtimescheduler"
327-
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
328+
ss.pod_target_xcconfig = {"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"",
329+
"GCC_WARN_PEDANTIC" => "YES" }
328330
end
329331

330332
s.subspec "utils" do |ss|
331333
ss.source_files = "react/utils/*.{m,mm,cpp,h}"
332334
ss.header_dir = "react/utils"
333-
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
335+
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\""}
334336
end
335337

336338
end

ReactCommon/React-bridging.podspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ else
1616
source[:tag] = "v#{version}"
1717
end
1818

19-
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
19+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-gnu-zero-variadic-macro-arguments'
2020
folly_version = '2021.07.22.00'
2121

2222
Pod::Spec.new do |s|
@@ -35,7 +35,8 @@ Pod::Spec.new do |s|
3535
s.compiler_flags = folly_compiler_flags
3636
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\"",
3737
"USE_HEADERMAP" => "YES",
38-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }
38+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
39+
"GCC_WARN_PEDANTIC" => "YES" }
3940

4041
s.dependency "RCT-Folly", folly_version
4142
s.dependency "React-jsi", version

ReactCommon/ReactCommon.podspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ else
1616
source[:tag] = "v#{version}"
1717
end
1818

19-
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
19+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-gnu-zero-variadic-macro-arguments'
2020
folly_version = '2021.07.22.00'
2121
boost_compiler_flags = '-Wno-documentation'
2222

@@ -34,7 +34,8 @@ 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\" \"$(PODS_ROOT)/Headers/Private/React-bridging/react/bridging\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-bridging/react_bridging.framework/Headers\"",
3636
"USE_HEADERMAP" => "YES",
37-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }
37+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
38+
"GCC_WARN_PEDANTIC" => "YES" }
3839

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

0 commit comments

Comments
 (0)