From 06d08009f6b67d0dc581e83766dffc81cd1cd902 Mon Sep 17 00:00:00 2001 From: rsgowman Date: Wed, 18 Jul 2018 12:58:22 -0400 Subject: 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. --- Firestore/CMakeLists.txt | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Firestore/CMakeLists.txt b/Firestore/CMakeLists.txt index fe7d8f4..8d1cd6c 100644 --- a/Firestore/CMakeLists.txt +++ b/Firestore/CMakeLists.txt @@ -148,20 +148,22 @@ podspec_framework( ${FIREBASE_SOURCE_DIR}/FirebaseAuthInterop.podspec ) -# FirebaseAuthInterop has no source files but CMake can't build frameworks that don't -# have sources. Generate an inconsequential source file so that the library can -# be linked. -file( - WRITE ${CMAKE_CURRENT_BINARY_DIR}/FirebaseAuthInteropDummy.c - "// generated file for header-only CMake support. - __attribute__((unused)) - static void FirebaseAuthInteropFakeSymbol() {} - " -) -target_sources( - FirebaseAuthInterop - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/FirebaseAuthInteropDummy.c -) +if(APPLE) + # FirebaseAuthInterop has no source files but CMake can't build frameworks + # that don't have sources. Generate an inconsequential source file so that + # the library can be linked. + file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/FirebaseAuthInteropDummy.c + "// generated file for header-only CMake support. + __attribute__((unused)) + static void FirebaseAuthInteropFakeSymbol() {} + " + ) + target_sources( + FirebaseAuthInterop + PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/FirebaseAuthInteropDummy.c + ) +endif() # Superbuild installed results -- cgit v1.2.3