diff options
Diffstat (limited to 'Firestore/core/src/firebase/firestore/util/CMakeLists.txt')
-rw-r--r-- | Firestore/core/src/firebase/firestore/util/CMakeLists.txt | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/Firestore/core/src/firebase/firestore/util/CMakeLists.txt b/Firestore/core/src/firebase/firestore/util/CMakeLists.txt index ebb2301..d70397d 100644 --- a/Firestore/core/src/firebase/firestore/util/CMakeLists.txt +++ b/Firestore/core/src/firebase/firestore/util/CMakeLists.txt @@ -15,6 +15,47 @@ add_library( firebase_firestore_util autoid.cc - log_stdio.cc secure_random_arc4random.cc ) + +# log_stdio can be built and tested everywhere +add_library( + firebase_firestore_util_log_stdio + log_stdio.cc +) + +# log_apple can only built and tested on apple plaforms +if(APPLE) + add_library( + firebase_firestore_util_log_apple + log_apple.mm + ) + target_compile_options( + firebase_firestore_util_log_apple + PRIVATE + ${OBJC_FLAGS} + ) + target_link_libraries( + firebase_firestore_util_log_apple + PUBLIC + FirebaseCore + ) +endif(APPLE) + +# Export a dependency on the correct logging library for this platform. All +# buildable libraries are built and tested but only the best fit is exported. +if(APPLE) + target_link_libraries( + firebase_firestore_util + PUBLIC + firebase_firestore_util_log_apple + ) + +else(NOT APPLE) + target_link_libraries( + firebase_firestore_util + PUBLIC + firebase_firestore_util_log_stdio + ) + +endif(APPLE) |