Skip to content

Commit

Permalink
Update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
compnerd committed Mar 6, 2024
1 parent e745bf1 commit 2860b07
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)

include(FetchContent)

# ${TOOLCHAIN_ROOT}/usr/include allows us to access swift C++ interop headers.
cmake_path(GET CMAKE_Swift_COMPILER PARENT_PATH _SWIFT_INCLUDE_DIR)
cmake_path(GET _SWIFT_INCLUDE_DIR PARENT_PATH _SWIFT_INCLUDE_DIR)
include_directories(SYSTEM ${_SWIFT_INCLUDE_DIR}/include)

add_library(firebase INTERFACE)
target_compile_options(firebase INTERFACE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xcc -DINTERNAL_EXPERIMENTAL>")
Expand All @@ -22,20 +27,23 @@ target_link_directories(firebase INTERFACE
third_party/firebase-development/usr/libs/windows/deps/app
third_party/firebase-development/usr/libs/windows/deps/app/external)

add_library(FirebaseCore
add_library(FirebaseCore SHARED
Sources/FirebaseCore/FirebaseApp+Swift.swift
Sources/FirebaseCore/FirebaseConfiguration.swift
Sources/FirebaseCore/FirebaseError.swift
Sources/FirebaseCore/FirebaseLogging+Swift.swift
Sources/FirebaseCore/FirebaseOptions+Swift.swift)
target_compile_options(FirebaseCore PRIVATE
-cxx-interoperability-mode=default)
target_link_libraries(FirebaseCore PUBLIC
firebase)
target_link_libraries(FirebaseCore PRIVATE
libcurl
firebase
firebase_app
flatbuffers
zlibstatic)

add_library(FirebaseAuth
add_library(FirebaseAuth SHARED
Sources/FirebaseAuth/FIRActionCodeOperation.swift
Sources/FirebaseAuth/FIRAuthTokenResult.swift
Sources/FirebaseAuth/FirebaseAuth+Swift.swift
Expand All @@ -45,14 +53,17 @@ add_library(FirebaseAuth
target_compile_options(FirebaseAuth PRIVATE
-cxx-interoperability-mode=default)
target_link_libraries(FirebaseAuth PUBLIC
firebase
FirebaseCore)
target_link_libraries(FirebaseAuth PRIVATE
crypto
firebase
firebase_rest_lib
flatbuffers)
flatbuffers
libcurl
ssl
zlibstatic)

add_library(FirebaseFirestore
add_library(FirebaseFirestore SHARED
Sources/FirebaseFirestore/CollectionReference+Swift.swift
Sources/FirebaseFirestore/DocumentReference+Swift.swift
Sources/FirebaseFirestore/DocumentSnapshot+Swift.swift
Expand All @@ -62,6 +73,7 @@ add_library(FirebaseFirestore
target_compile_options(FirebaseFirestore PRIVATE
-cxx-interoperability-mode=default)
target_link_libraries(FirebaseFirestore PUBLIC
firebase
FirebaseCore)
target_link_libraries(FirebaseFirestore PRIVATE
absl_bad_optional_access
Expand Down Expand Up @@ -103,7 +115,7 @@ target_link_libraries(FirebaseFirestore PRIVATE
absl_time_zone
address_sorting
cares
firebase
crypto
firestore_core
firestore_nanopb
firestore_protos_nanopb
Expand All @@ -112,11 +124,13 @@ target_link_libraries(FirebaseFirestore PRIVATE
grpc
grpc++
leveldb
libcurl
protobuf-nanopb
re2
snappy
ssl
upb)
upb
zlibstatic)

FetchContent_Declare(SwiftWin32
GIT_REPOSITORY https://github.com/compnerd/swift-win32
Expand Down

0 comments on commit 2860b07

Please sign in to comment.