Skip to content

Commit 2d12fd5

Browse files
authored
Enable -Wcomma for our build; disable it for abseil. (firebase#799)
In order to use different cflags for abseil, this patch splits it out into a subspec within the pod. The cmake side of things "just works" since Firestore/CMakeLists.txt includes abseil before setting our compiler flags.
1 parent 46355e5 commit 2d12fd5

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

FirebaseFirestore.podspec

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
3535
'Firestore/core/include/**/*.{h,cc,mm}',
3636
'Firestore/core/src/**/*.{h,cc,mm}',
3737
'Firestore/third_party/Immutable/*.[mh]',
38-
'Firestore/third_party/abseil-cpp/**/*.{h,cc}'
3938
]
4039
s.requires_arc = [
4140
'Firestore/Source/**/*',
@@ -45,7 +44,6 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
4544
s.exclude_files = [
4645
'Firestore/Port/*test.cc',
4746
'Firestore/third_party/Immutable/Tests/**',
48-
'Firestore/third_party/abseil-cpp/**/*_test.{h,cc}',
4947

5048
# Exclude alternate implementations for other platforms
5149
'Firestore/core/src/firebase/firestore/util/assert_stdio.cc',
@@ -79,4 +77,19 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
7977
Firestore/core/src/firebase/firestore/util/config.h.in > \
8078
Firestore/core/src/firebase/firestore/util/config.h
8179
CMD
80+
81+
s.subspec 'abseil-cpp' do |ss|
82+
ss.preserve_path = [
83+
'Firestore/third_party/abseil-cpp/absl'
84+
]
85+
ss.source_files = [
86+
'Firestore/third_party/abseil-cpp/**/*.cc'
87+
]
88+
ss.exclude_files = [
89+
'Firestore/third_party/abseil-cpp/**/*_test.cc',
90+
]
91+
92+
ss.library = 'c++'
93+
ss.compiler_flags = '$(inherited) ' + '-Wno-comma'
94+
end
8295
end

cmake/CompilerSetup.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ if(CLANG OR GNU)
6161
APPEND common_flags
6262
-Wconditional-uninitialized -Werror=return-type -Winfinite-recursion -Wmove
6363
-Wrange-loop-analysis -Wunreachable-code
64+
65+
# Options added to match apple recommended project settings
66+
-Wcomma
6467
)
6568
endif()
6669

0 commit comments

Comments
 (0)