Skip to content

Commit

Permalink
build: isolate libcurl and zlibstatic to Windows
Browse files Browse the repository at this point in the history
When building for Android, we do not wish to link against this
libraries, least of all because they are spelt differently (`curl` and
`z` respectively). This allows us to make further progress on linking
binaries for android targets.
  • Loading branch information
compnerd committed Jun 18, 2024
1 parent 249bdf9 commit 3a46498
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ target_compile_options(FirebaseCore PRIVATE
target_link_libraries(FirebaseCore PUBLIC
firebase)
target_link_libraries(FirebaseCore PRIVATE
libcurl
firebase_app
flatbuffers
zlibstatic)
$<$<PLATFORM_ID:Windows>:libcurl>
$<$<PLATFORM_ID:Windows>:zlibstatic>)
if(ANDROID)
target_link_libraries(FirebaseCore PRIVATE
FirebaseAndroidJNI)
Expand All @@ -87,9 +87,9 @@ target_link_libraries(FirebaseAuth PRIVATE
crypto
firebase_rest_lib
flatbuffers
libcurl
ssl
zlibstatic)
$<$<PLATFORM_ID:Windows>:libcurl>
$<$<PLATFORM_ID:Windows>:zlibstatic>)

add_library(FirebaseFirestore SHARED
Sources/FirebaseFirestore/Vendor/Codable/CodableErrors.swift
Expand Down Expand Up @@ -185,7 +185,6 @@ target_link_libraries(FirebaseFirestore PUBLIC
grpc
grpc++
leveldb
libcurl
protobuf-nanopb
re2
snappy
Expand All @@ -197,7 +196,8 @@ target_link_libraries(FirebaseFirestore PUBLIC
upb_textformat_lib
utf8_range_lib
utf8_validity
zlibstatic)
$<$<PLATFORM_ID:Windows>:libcurl>
$<$<PLATFORM_ID:Windows>:zlibstatic>)

add_library(FirebaseFunctions SHARED
Sources/FirebaseFunctions/FunctionsErrorCode.swift
Expand All @@ -214,9 +214,9 @@ target_link_libraries(FirebaseFunctions PRIVATE
crypto
firebase_rest_lib
flatbuffers
libcurl
ssl
zlibstatic)
$<$<PLATFORM_ID:Windows>:libcurl>
$<$<PLATFORM_ID:Windows>:zlibstatic>)

add_library(FirebaseStorage SHARED
Sources/FirebaseStorage/StorageErrorCode.swift
Expand All @@ -233,9 +233,9 @@ target_link_libraries(FirebaseStorage PRIVATE
crypto
firebase_rest_lib
flatbuffers
libcurl
ssl
zlibstatic)
$<$<PLATFORM_ID:Windows>:libcurl>
$<$<PLATFORM_ID:Windows>:zlibstatic>)

if(SWIFT_FIREBASE_BUILD_EXAMPLES)
FetchContent_Declare(SwiftWin32
Expand Down

0 comments on commit 3a46498

Please sign in to comment.