Skip to content

Commit 7af0b2d

Browse files
committed
build: isolate libcurl and zlibstatic to Windows
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.
1 parent a75385a commit 7af0b2d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ target_compile_options(FirebaseCore PRIVATE
6060
target_link_libraries(FirebaseCore PUBLIC
6161
firebase)
6262
target_link_libraries(FirebaseCore PRIVATE
63-
libcurl
6463
firebase_app
6564
flatbuffers
66-
zlibstatic)
65+
$<$<PLATFORM_ID:Windows>:libcurl>
66+
$<$<PLATFORM_ID:Windows>:zlibstatic>)
6767
if(ANDROID)
6868
target_link_libraries(FirebaseCore PRIVATE
6969
FirebaseAndroidJNI)
@@ -87,9 +87,9 @@ target_link_libraries(FirebaseAuth PRIVATE
8787
crypto
8888
firebase_rest_lib
8989
flatbuffers
90-
libcurl
9190
ssl
92-
zlibstatic)
91+
$<$<PLATFORM_ID:Windows>:libcurl>
92+
$<$<PLATFORM_ID:Windows>:zlibstatic>)
9393

9494
add_library(FirebaseFirestore SHARED
9595
Sources/FirebaseFirestore/Vendor/Codable/CodableErrors.swift
@@ -185,7 +185,6 @@ target_link_libraries(FirebaseFirestore PUBLIC
185185
grpc
186186
grpc++
187187
leveldb
188-
libcurl
189188
protobuf-nanopb
190189
re2
191190
snappy
@@ -197,7 +196,8 @@ target_link_libraries(FirebaseFirestore PUBLIC
197196
upb_textformat_lib
198197
utf8_range_lib
199198
utf8_validity
200-
zlibstatic)
199+
$<$<PLATFORM_ID:Windows>:libcurl>
200+
$<$<PLATFORM_ID:Windows>:zlibstatic>)
201201

202202
add_library(FirebaseFunctions SHARED
203203
Sources/FirebaseFunctions/FunctionsErrorCode.swift
@@ -214,9 +214,9 @@ target_link_libraries(FirebaseFunctions PRIVATE
214214
crypto
215215
firebase_rest_lib
216216
flatbuffers
217-
libcurl
218217
ssl
219-
zlibstatic)
218+
$<$<PLATFORM_ID:Windows>:libcurl>
219+
$<$<PLATFORM_ID:Windows>:zlibstatic>)
220220

221221
add_library(FirebaseStorage SHARED
222222
Sources/FirebaseStorage/StorageErrorCode.swift
@@ -233,9 +233,9 @@ target_link_libraries(FirebaseStorage PRIVATE
233233
crypto
234234
firebase_rest_lib
235235
flatbuffers
236-
libcurl
237236
ssl
238-
zlibstatic)
237+
$<$<PLATFORM_ID:Windows>:libcurl>
238+
$<$<PLATFORM_ID:Windows>:zlibstatic>)
239239

240240
if(SWIFT_FIREBASE_BUILD_EXAMPLES)
241241
FetchContent_Declare(SwiftWin32

0 commit comments

Comments
 (0)