Skip to content

Commit dce0a2e

Browse files
authored
Remove extra inclusion of pb_common.c and pb_decode.c, to avoid multiple symbol definitions. (#275)
* Remove extra inclusion of pb_common.c and pb_decode.c, to avoid multiple symbol definitions. * Add nanopb library as a link-time dependency.
1 parent 2c5a642 commit dce0a2e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

remote_config/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ if (NOT PROTOBUF_FOUND)
6666
else()
6767
# Generates config.pb.c and config.pb.h
6868
NANOPB_GENERATE_CPP(PROTO_SRCS PROTO_HDRS src_protos/config.proto)
69+
# Remove pb_common.c and pb_decode.c from PROTO_SRCS, as they are
70+
# provided by Firebase App. Including them here causes symbols to
71+
# have multiple definitions.
72+
list(FILTER PROTO_SRCS EXCLUDE REGEX "/pb_.*\\.c")
73+
6974
set(desktop_SRCS
7075
${PROTO_SRCS}
7176
${PROTO_HDRS}
@@ -111,6 +116,7 @@ else()
111116
set(additional_link_LIB
112117
firebase_rest_lib
113118
firebase_instance_id_desktop_impl
119+
protobuf-nanopb-static
114120
flatbuffers)
115121
endif()
116122

0 commit comments

Comments
 (0)