From ed3f2650365e0d86979650dadf4941e6eb5ae766 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 18 Jun 2024 18:06:10 -0700 Subject: [PATCH] Functions: make `FirebaseFunctions` build for Android Remove some linkage on Android as the libraries are not present. It is unclear if this is underlinking, but for now, this allows us to make progress. Explicitly cast the error value as it is a `DWORD` on Windows and `CInt` on Unix. --- CMakeLists.txt | 6 +++--- Sources/FirebaseFunctions/FunctionsErrorCode.swift | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f51e17..e05419a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -209,11 +209,11 @@ target_link_libraries(FirebaseFunctions PUBLIC firebase_functions FirebaseCore) target_link_libraries(FirebaseFunctions PRIVATE - crypto - firebase_rest_lib flatbuffers - ssl + $<$:crypto> + $<$:firebase_rest_lib> $<$:libcurl> + $<$:ssl> $<$:zlibstatic>) add_library(FirebaseStorage SHARED diff --git a/Sources/FirebaseFunctions/FunctionsErrorCode.swift b/Sources/FirebaseFunctions/FunctionsErrorCode.swift index aa32aa0..584c9f4 100644 --- a/Sources/FirebaseFunctions/FunctionsErrorCode.swift +++ b/Sources/FirebaseFunctions/FunctionsErrorCode.swift @@ -30,7 +30,7 @@ extension FunctionsErrorCode: RawRepresentable { extension FunctionsErrorCode { init(_ error: firebase.functions.Error, errorMessage: String?) { - self.init((code: error.rawValue, message: errorMessage ?? "\(error.rawValue)")) + self.init((code: numericCast(error.rawValue), message: errorMessage ?? "\(error.rawValue)")) } init?(_ error: firebase.functions.Error?, errorMessage: UnsafePointer?) {