Skip to content

Commit 8ac2f3e

Browse files
committed
build: add support for platform selection in firebase-cpp-sdk
swift-firebase uses the firebase-cpp-sdk as a foundation for building the Swift interfaces. This is a native C++ library which requires a variant for each supported platform. Generalise the path selection to support additional platforms such as Android.
1 parent 68a244d commit 8ac2f3e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,19 @@ target_compile_options(firebase INTERFACE
2525
target_include_directories(firebase INTERFACE
2626
Sources/firebase/include
2727
third_party/firebase-development/usr/include)
28-
target_link_directories(firebase INTERFACE
29-
third_party/firebase-development/usr/libs/windows
30-
third_party/firebase-development/usr/libs/windows/deps/app
31-
third_party/firebase-development/usr/libs/windows/deps/app/external)
28+
if(ANDROID)
29+
target_link_directories(firebase INTERFACE
30+
third_party/firebase-development/usr/libs/android
31+
third_party/firebase-development/usr/libs/android/deps/app
32+
third_party/firebase-development/usr/libs/android/deps/app/external)
33+
elseif(WIN32)
34+
target_link_directories(firebase INTERFACE
35+
third_party/firebase-development/usr/libs/windows
36+
third_party/firebase-development/usr/libs/windows/deps/app
37+
third_party/firebase-development/usr/libs/windows/deps/app/external)
38+
else()
39+
message(FATAL_ERROR "unsupported firebase-cpp-sdk platform")
40+
endif()
3241

3342
add_library(FirebaseCore SHARED
3443
Sources/FirebaseCore/FirebaseApp+Swift.swift

0 commit comments

Comments
 (0)