From 9f7c094f9f00a6efc0107071f109ef1bc4d7357d Mon Sep 17 00:00:00 2001 From: Gil Date: Fri, 19 Jan 2018 12:20:46 -0800 Subject: Add platform detection logic for SecureRandom (#676) * Add CMake platform detection logic for SecureRandom Now only builds secure_random_arc4random.cc if available. Remove firebase/firestore/base/port.h. Nothing else was in that directory. * Add a SecureRandom implementation that uses OpenSSL This is usable on Linux, Windows, and Android * Properly check return from RAND_bytes --- FirebaseFirestore.podspec | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'FirebaseFirestore.podspec') diff --git a/FirebaseFirestore.podspec b/FirebaseFirestore.podspec index b6b2966..af8770b 100644 --- a/FirebaseFirestore.podspec +++ b/FirebaseFirestore.podspec @@ -47,7 +47,8 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling, # Exclude alternate implementations for other platforms 'Firestore/core/src/firebase/firestore/util/assert_stdio.cc', - 'Firestore/core/src/firebase/firestore/util/log_stdio.cc' + 'Firestore/core/src/firebase/firestore/util/log_stdio.cc', + 'Firestore/core/src/firebase/firestore/util/secure_random_openssl.cc' ] s.public_header_files = 'Firestore/Source/Public/*.h' @@ -66,4 +67,12 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling, '"${PODS_TARGET_SRCROOT}/Firestore/third_party/abseil-cpp"', 'OTHER_CFLAGS' => '-DFIRFirestore_VERSION=' + s.version.to_s } + + s.prepare_command = <<-CMD + # Generate a version of the config.h header suitable for building with + # CocoaPods. + sed '/^#cmakedefine/ d' \ + Firestore/core/src/firebase/firestore/util/config.h.in > \ + Firestore/core/src/firebase/firestore/util/config.h + CMD end -- cgit v1.2.3