Skip to content

Commit 06d0800

Browse files
authored
Fix broken build under linux (#1551)
FirebaseAuthInterop isn't defined as a target under linux (since it comes from the podfiles) so defining a source file for the target causes cmake to error.
1 parent 40d5e88 commit 06d0800

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

Firestore/CMakeLists.txt

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -148,20 +148,22 @@ podspec_framework(
148148
${FIREBASE_SOURCE_DIR}/FirebaseAuthInterop.podspec
149149
)
150150

151-
# FirebaseAuthInterop has no source files but CMake can't build frameworks that don't
152-
# have sources. Generate an inconsequential source file so that the library can
153-
# be linked.
154-
file(
155-
WRITE ${CMAKE_CURRENT_BINARY_DIR}/FirebaseAuthInteropDummy.c
156-
"// generated file for header-only CMake support.
157-
__attribute__((unused))
158-
static void FirebaseAuthInteropFakeSymbol() {}
159-
"
160-
)
161-
target_sources(
162-
FirebaseAuthInterop
163-
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/FirebaseAuthInteropDummy.c
164-
)
151+
if(APPLE)
152+
# FirebaseAuthInterop has no source files but CMake can't build frameworks
153+
# that don't have sources. Generate an inconsequential source file so that
154+
# the library can be linked.
155+
file(
156+
WRITE ${CMAKE_CURRENT_BINARY_DIR}/FirebaseAuthInteropDummy.c
157+
"// generated file for header-only CMake support.
158+
__attribute__((unused))
159+
static void FirebaseAuthInteropFakeSymbol() {}
160+
"
161+
)
162+
target_sources(
163+
FirebaseAuthInterop
164+
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/FirebaseAuthInteropDummy.c
165+
)
166+
endif()
165167

166168

167169
# Superbuild installed results

0 commit comments

Comments
 (0)