Skip to content

Commit

Permalink
Functions: make FirebaseFunctions build for Android
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
compnerd committed Jun 20, 2024
1 parent 7dafa0c commit 5e507b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ target_link_libraries(FirebaseFunctions PUBLIC
firebase_functions
FirebaseCore)
target_link_libraries(FirebaseFunctions PRIVATE
crypto
firebase_rest_lib
flatbuffers
ssl
$<$<PLATFORM_ID:Windows>:crypto>
$<$<PLATFORM_ID:Windows>:firebase_rest_lib>
$<$<PLATFORM_ID:Windows>:libcurl>
$<$<PLATFORM_ID:Windows>:ssl>
$<$<PLATFORM_ID:Windows>:zlibstatic>)

add_library(FirebaseStorage SHARED
Expand Down
2 changes: 1 addition & 1 deletion Sources/FirebaseFunctions/FunctionsErrorCode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: Int32(bitPattern: error.rawValue), message: errorMessage ?? "\(error.rawValue)"))
}

init?(_ error: firebase.functions.Error?, errorMessage: UnsafePointer<CChar>?) {
Expand Down

0 comments on commit 5e507b7

Please sign in to comment.