aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Marek Gilbert <mcg@google.com>2017-12-09 17:41:58 -0800
committerGravatar Marek Gilbert <mcg@google.com>2017-12-09 17:41:58 -0800
commit035411e3ab4f799ff1f19963d589ebdc823b02c1 (patch)
treed7a242c96ac460b4a90e2de8db11770334a94f24
parentcd17b85587d1a827389ea1e18d0ce5622606cd5f (diff)
parentb3b3987fc0d57da58eff9fee3ba65f57cea97a65 (diff)
Merge branch 'master' into abseil-import
-rw-r--r--CMakeLists.txt1
-rw-r--r--Example/Auth/Tests/FIRAuthAPNSTokenManagerTests.m2
-rw-r--r--Example/Auth/Tests/FIRAuthDispatcherTests.m2
-rw-r--r--Example/Auth/Tests/FIRAuthTests.m2
-rw-r--r--Example/Auth/Tests/FIRAuthURLPresenterTests.m2
-rw-r--r--Example/Auth/Tests/FIRPhoneAuthProviderTests.m2
-rw-r--r--Example/Auth/Tests/FIRUserTests.m2
-rw-r--r--Example/Core/Tests/FIRAppTest.m15
-rw-r--r--Example/Core/Tests/FIRLoggerTest.m7
-rw-r--r--Example/Core/Tests/FIROptionsTest.m9
-rw-r--r--Firebase/Core/third_party/FIRAppEnvironmentUtil.m14
-rw-r--r--Firebase/Messaging/FIRMessaging.m5
-rw-r--r--Firebase/Messaging/FIRMessagingContextManagerService.m2
-rw-r--r--Firebase/Messaging/FIRMessagingRmq2PersistentStore.m10
-rw-r--r--Firestore/third_party/abseil-cpp/CMakeLists.txt15
-rw-r--r--Firestore/third_party/abseil-cpp/absl/CMakeLists.txt9
-rw-r--r--Firestore/third_party/abseil-cpp/absl/base/CMakeLists.txt234
-rw-r--r--Firestore/third_party/abseil-cpp/absl/base/config_test.cc17
-rw-r--r--Firestore/third_party/abseil-cpp/absl/meta/CMakeLists.txt3
-rw-r--r--Firestore/third_party/abseil-cpp/absl/strings/CMakeLists.txt176
-rw-r--r--cmake/external/abseil-cpp.cmake35
-rw-r--r--cmake/external/firestore.cmake2
22 files changed, 102 insertions, 464 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f9e7527..efea997 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,4 +27,5 @@ set(FIREBASE_DOWNLOAD_DIR "${PROJECT_SOURCE_DIR}/.downloads")
enable_testing()
include(external/googletest)
+include(external/abseil-cpp)
include(external/firestore)
diff --git a/Example/Auth/Tests/FIRAuthAPNSTokenManagerTests.m b/Example/Auth/Tests/FIRAuthAPNSTokenManagerTests.m
index 68e8bcf..79ffb7a 100644
--- a/Example/Auth/Tests/FIRAuthAPNSTokenManagerTests.m
+++ b/Example/Auth/Tests/FIRAuthAPNSTokenManagerTests.m
@@ -31,7 +31,7 @@ static const NSTimeInterval kRegistrationTimeout = .5;
@brief The test expectation timeout.
@remarks This must be considerably greater than @c kVerificationTimeout .
*/
-static const NSTimeInterval kExpectationTimeout = 1;
+static const NSTimeInterval kExpectationTimeout = 2;
/** @class FIRAuthLegacyUIApplication
@brief A fake legacy (< iOS 7) UIApplication class.
diff --git a/Example/Auth/Tests/FIRAuthDispatcherTests.m b/Example/Auth/Tests/FIRAuthDispatcherTests.m
index fc8cab1..193be4c 100644
--- a/Example/Auth/Tests/FIRAuthDispatcherTests.m
+++ b/Example/Auth/Tests/FIRAuthDispatcherTests.m
@@ -32,7 +32,7 @@ NSTimeInterval kTestDelay = 0.1;
/** @var kExpectationTimeout
@brief The maximum time waiting for expectations to fulfill.
*/
-static const NSTimeInterval kExpectationTimeout = 1;
+static const NSTimeInterval kExpectationTimeout = 2;
id<OS_dispatch_queue> testWorkQueue;
diff --git a/Example/Auth/Tests/FIRAuthTests.m b/Example/Auth/Tests/FIRAuthTests.m
index 80a9ae9..6391b08 100644
--- a/Example/Auth/Tests/FIRAuthTests.m
+++ b/Example/Auth/Tests/FIRAuthTests.m
@@ -170,7 +170,7 @@ static NSString *const kVerificationID = @"55432";
/** @var kExpectationTimeout
@brief The maximum time waiting for expectations to fulfill.
*/
-static const NSTimeInterval kExpectationTimeout = 1;
+static const NSTimeInterval kExpectationTimeout = 2;
/** @var kWaitInterval
@brief The time waiting for background tasks to finish before continue when necessary.
diff --git a/Example/Auth/Tests/FIRAuthURLPresenterTests.m b/Example/Auth/Tests/FIRAuthURLPresenterTests.m
index fcc64e9..a4e6c53 100644
--- a/Example/Auth/Tests/FIRAuthURLPresenterTests.m
+++ b/Example/Auth/Tests/FIRAuthURLPresenterTests.m
@@ -26,7 +26,7 @@
/** @var kExpectationTimeout
@brief The maximum time waiting for expectations to fulfill.
*/
-static NSTimeInterval kExpectationTimeout = 1;
+static NSTimeInterval kExpectationTimeout = 2;
@interface FIRAuthDefaultUIDelegate : NSObject <FIRAuthUIDelegate>
/** @fn defaultUIDelegate
diff --git a/Example/Auth/Tests/FIRPhoneAuthProviderTests.m b/Example/Auth/Tests/FIRPhoneAuthProviderTests.m
index c5f4ec7..0dc0b44 100644
--- a/Example/Auth/Tests/FIRPhoneAuthProviderTests.m
+++ b/Example/Auth/Tests/FIRPhoneAuthProviderTests.m
@@ -180,7 +180,7 @@ static const NSTimeInterval kTestTimeout = 5;
/** @var kExpectationTimeout
@brief The maximum time waiting for expectations to fulfill.
*/
-static const NSTimeInterval kExpectationTimeout = 1;
+static const NSTimeInterval kExpectationTimeout = 2;
/** @class FIRPhoneAuthProviderTests
@brief Tests for @c FIRPhoneAuthProvider
diff --git a/Example/Auth/Tests/FIRUserTests.m b/Example/Auth/Tests/FIRUserTests.m
index c044e83..68ee265 100644
--- a/Example/Auth/Tests/FIRUserTests.m
+++ b/Example/Auth/Tests/FIRUserTests.m
@@ -231,7 +231,7 @@ static NSTimeInterval const kLastSignInDateTimeIntervalInSeconds = 1505858583;
/** @var kExpectationTimeout
@brief The maximum time waiting for expectations to fulfill.
*/
-static const NSTimeInterval kExpectationTimeout = 1;
+static const NSTimeInterval kExpectationTimeout = 2;
/** @class FIRUserTests
@brief Tests for @c FIRUser .
diff --git a/Example/Core/Tests/FIRAppTest.m b/Example/Core/Tests/FIRAppTest.m
index 9b3554d..ac7985a 100644
--- a/Example/Core/Tests/FIRAppTest.m
+++ b/Example/Core/Tests/FIRAppTest.m
@@ -96,7 +96,10 @@ NSString *const kFIRTestAppName2 = @"test-app-name-2";
- (void)testConfigureWithOptions {
// nil options
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
XCTAssertThrows([FIRApp configureWithOptions:nil]);
+#pragma clang diagnostic pop
XCTAssertTrue([FIRApp allApps].count == 0);
NSDictionary *expectedUserInfo =
@@ -117,6 +120,9 @@ NSString *const kFIRTestAppName2 = @"test-app-name-2";
- (void)testConfigureWithCustomizedOptions {
// valid customized options
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
FIROptions *options = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID
bundleID:kBundleID
GCMSenderID:kGCMSenderID
@@ -127,7 +133,7 @@ NSString *const kFIRTestAppName2 = @"test-app-name-2";
databaseURL:nil
storageBucket:nil
deepLinkURLScheme:nil];
-
+#pragma clang diagnostic pop
NSDictionary *expectedUserInfo =
[self expectedUserInfoWithAppName:kFIRDefaultAppName isDefaultApp:YES];
OCMExpect([self.notificationCenterMock postNotificationName:kFIRAppReadyToConfigureSDKNotification
@@ -146,8 +152,11 @@ NSString *const kFIRTestAppName2 = @"test-app-name-2";
}
- (void)testConfigureWithNameAndOptions {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
XCTAssertThrows([FIRApp configureWithName:nil options:[FIROptions defaultOptions]]);
XCTAssertThrows([FIRApp configureWithName:kFIRTestAppName1 options:nil]);
+#pragma clang diagnostic pop
XCTAssertThrows([FIRApp configureWithName:@"" options:[FIROptions defaultOptions]]);
XCTAssertThrows(
[FIRApp configureWithName:kFIRDefaultAppName options:[FIROptions defaultOptions]]);
@@ -186,6 +195,9 @@ NSString *const kFIRTestAppName2 = @"test-app-name-2";
self.app = [FIRApp appNamed:kFIRTestAppName1];
// Configure a different app with valid customized options
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
FIROptions *customizedOptions = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID
bundleID:kBundleID
GCMSenderID:kGCMSenderID
@@ -196,6 +208,7 @@ NSString *const kFIRTestAppName2 = @"test-app-name-2";
databaseURL:nil
storageBucket:nil
deepLinkURLScheme:nil];
+#pragma clang diagnostic pop
NSDictionary *expectedUserInfo2 =
[self expectedUserInfoWithAppName:kFIRTestAppName2 isDefaultApp:NO];
diff --git a/Example/Core/Tests/FIRLoggerTest.m b/Example/Core/Tests/FIRLoggerTest.m
index 7740527..0894fd6 100644
--- a/Example/Core/Tests/FIRLoggerTest.m
+++ b/Example/Core/Tests/FIRLoggerTest.m
@@ -149,7 +149,11 @@ static NSString *const kMessageCode = @"I-COR000001";
XCTAssertThrows(FIRLogError(kFIRLoggerCore, @"I-app000001", @"Message."));
// nil or empty message code should fail.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
XCTAssertThrows(FIRLogError(kFIRLoggerCore, nil, @"Message."));
+#pragma clang diagnostic pop
+
XCTAssertThrows(FIRLogError(kFIRLoggerCore, @"", @"Message."));
// Android message code should fail.
@@ -241,6 +245,8 @@ static NSString *const kMessageCode = @"I-COR000001";
}
- (BOOL)messageWasLogged:(NSString *)message {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
aslmsg query = asl_new(ASL_TYPE_QUERY);
asl_set_query(query, ASL_KEY_FACILITY, kFIRLoggerASLClientFacilityName, ASL_QUERY_OP_EQUAL);
aslresponse r = asl_search(getFIRLoggerClient(), query);
@@ -257,6 +263,7 @@ static NSString *const kMessageCode = @"I-COR000001";
asl_free(m);
asl_release(r);
return [allMsg containsObject:message];
+#pragma clang pop
}
@end
diff --git a/Example/Core/Tests/FIROptionsTest.m b/Example/Core/Tests/FIROptionsTest.m
index d01eec5..a1e5fae 100644
--- a/Example/Core/Tests/FIROptionsTest.m
+++ b/Example/Core/Tests/FIROptionsTest.m
@@ -80,6 +80,7 @@ extern NSString *const kFIRLibraryVersionID;
}
- (void)testInitCustomizedOptions {
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
FIROptions *options = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID
bundleID:kBundleID
GCMSenderID:kGCMSenderID
@@ -90,6 +91,7 @@ extern NSString *const kFIRLibraryVersionID;
databaseURL:kDatabaseURL
storageBucket:kStorageBucket
deepLinkURLScheme:kDeepLinkURLScheme];
+#pragma clang pop
[self assertOptionsMatchDefaults:options andProjectID:NO];
XCTAssertEqualObjects(options.deepLinkURLScheme, kDeepLinkURLScheme);
XCTAssertFalse(options.usingOptionsFromDefaultPlist);
@@ -110,6 +112,9 @@ extern NSString *const kFIRLibraryVersionID;
XCTAssertFalse(options.usingOptionsFromDefaultPlist);
// nil GoogleAppID should throw an exception
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
XCTAssertThrows([[FIROptions alloc] initWithGoogleAppID:nil
bundleID:kBundleID
GCMSenderID:kGCMSenderID
@@ -120,6 +125,7 @@ extern NSString *const kFIRLibraryVersionID;
databaseURL:nil
storageBucket:nil
deepLinkURLScheme:nil]);
+#pragma clang diagnostic pop
}
- (void)testinitWithContentsOfFile {
@@ -130,7 +136,10 @@ extern NSString *const kFIRLibraryVersionID;
XCTAssertNil(options.deepLinkURLScheme);
XCTAssertFalse(options.usingOptionsFromDefaultPlist);
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
FIROptions *emptyOptions = [[FIROptions alloc] initWithContentsOfFile:nil];
+#pragma clang diagnostic pop
XCTAssertNil(emptyOptions);
FIROptions *invalidOptions = [[FIROptions alloc] initWithContentsOfFile:@"invalid.plist"];
diff --git a/Firebase/Core/third_party/FIRAppEnvironmentUtil.m b/Firebase/Core/third_party/FIRAppEnvironmentUtil.m
index 3a08cfa..337f082 100644
--- a/Firebase/Core/third_party/FIRAppEnvironmentUtil.m
+++ b/Firebase/Core/third_party/FIRAppEnvironmentUtil.m
@@ -36,6 +36,10 @@ struct encryption_info_command {
@implementation FIRAppEnvironmentUtil
+/// A key for the Info.plist to enable or disable checking if the App Store is running in a sandbox,
+/// which would be true while running on TestFlight.
+static NSString *const kFIRAppStoreSandboxCheckEnabledKey = @"FirebaseAppStoreSandboxCheckEnabled";
+
/// The file name of the sandbox receipt. This is available on iOS >= 8.0
static NSString *const kFIRAIdentitySandboxReceiptFileName = @"sandboxReceipt";
@@ -152,6 +156,16 @@ static BOOL isAppEncrypted() {
}
+ (BOOL)isAppStoreReceiptSandbox {
+ // Since checking the App Store's receipt URL can be memory intensive, check the option in the
+ // Info.plist if developers opted out of this check.
+ id enableSandboxCheck =
+ [[NSBundle mainBundle] objectForInfoDictionaryKey:kFIRAppStoreSandboxCheckEnabledKey];
+ if (enableSandboxCheck &&
+ [enableSandboxCheck isKindOfClass:[NSNumber class]] &&
+ ![enableSandboxCheck boolValue]) {
+ return NO;
+ }
+
NSURL *appStoreReceiptURL = [NSBundle mainBundle].appStoreReceiptURL;
NSString *appStoreReceiptFileName = appStoreReceiptURL.lastPathComponent;
return [appStoreReceiptFileName isEqualToString:kFIRAIdentitySandboxReceiptFileName];
diff --git a/Firebase/Messaging/FIRMessaging.m b/Firebase/Messaging/FIRMessaging.m
index 782b779..23feee9 100644
--- a/Firebase/Messaging/FIRMessaging.m
+++ b/Firebase/Messaging/FIRMessaging.m
@@ -384,7 +384,6 @@ NSString * const FIRMessagingRegistrationTokenRefreshedNotification =
id<UIApplicationDelegate> appDelegate = application.delegate;
SEL continueUserActivitySelector =
@selector(application:continueUserActivity:restorationHandler:);
- SEL openURLWithOptionsSelector = @selector(application:openURL:options:);
SEL openURLWithSourceApplicationSelector =
@selector(application:openURL:sourceApplication:annotation:);
SEL handleOpenURLSelector = @selector(application:handleOpenURL:);
@@ -403,7 +402,7 @@ NSString * const FIRMessagingRegistrationTokenRefreshedNotification =
// Do nothing, as we don't support the app calling this block
}];
- } else if ([appDelegate respondsToSelector:openURLWithOptionsSelector]) {
+ } else if (@available(iOS 9.0, *)) {
[appDelegate application:application openURL:url options:@{}];
// Similarly, |application:openURL:sourceApplication:annotation:| will also always be called, due
@@ -727,7 +726,7 @@ NSString * const FIRMessagingRegistrationTokenRefreshedNotification =
- (void)receiver:(FIRMessagingReceiver *)receiver
receivedRemoteMessage:(FIRMessagingRemoteMessage *)remoteMessage {
- if ([self.delegate respondsToSelector:@selector(messaging:didReceiveMessage:)]) {
+ if (@available(iOS 10.0, *)) {
[self.delegate messaging:self didReceiveMessage:remoteMessage];
} else if ([self.delegate respondsToSelector:@selector(applicationReceivedRemoteMessage:)]) {
#pragma clang diagnostic push
diff --git a/Firebase/Messaging/FIRMessagingContextManagerService.m b/Firebase/Messaging/FIRMessagingContextManagerService.m
index 1c9f653..dffd6ae 100644
--- a/Firebase/Messaging/FIRMessagingContextManagerService.m
+++ b/Firebase/Messaging/FIRMessagingContextManagerService.m
@@ -143,7 +143,7 @@ typedef NS_ENUM(NSUInteger, FIRMessagingContextManagerMessageType) {
}
if ([apsDictionary[kFIRMessagingContextManagerTitleKey] length]) {
// |alertTitle| is iOS 8.2+, so check if we can set it
- if ([notification respondsToSelector:@selector(setAlertTitle:)]) {
+ if (@available(iOS 8.2, *)) {
notification.alertTitle = apsDictionary[kFIRMessagingContextManagerTitleKey];
}
}
diff --git a/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m b/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m
index a85298c..e468333 100644
--- a/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m
+++ b/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m
@@ -104,9 +104,13 @@ typedef void(^FCMOutgoingRmqMessagesTableHandler)(int64_t rmqId, int8_t tag, NSD
// Utility to create an NSString from a sqlite3 result code
NSString * _Nonnull FIRMessagingStringFromSQLiteResult(int result) {
- const char *errorStr = sqlite3_errstr(result);
- NSString *errorString = [NSString stringWithFormat:@"%d - %s", result, errorStr];
- return errorString;
+ const char *errorStr;
+ if (@available(iOS 8.2, *)) {
+ errorStr = sqlite3_errstr(result);
+ } else {
+ errorStr = "pre iOS 8.2";
+ }
+ return [NSString stringWithFormat:@"%d - %s", result, errorStr];
}
@interface FIRMessagingRmq2PersistentStore () {
diff --git a/Firestore/third_party/abseil-cpp/CMakeLists.txt b/Firestore/third_party/abseil-cpp/CMakeLists.txt
index e87f4a8..1c53a72 100644
--- a/Firestore/third_party/abseil-cpp/CMakeLists.txt
+++ b/Firestore/third_party/abseil-cpp/CMakeLists.txt
@@ -53,15 +53,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_WARNING_VLA} ${CMAKE_CXX_FLAGS} ")
## pthread
find_package(Threads REQUIRED)
-# commented: used only for standalone test
-#add_subdirectory(cctz)
-#add_subdirectory(googletest)
-
-## check targets
-check_target(cctz)
-check_target(gtest)
-check_target(gtest_main)
-check_target(gmock)
+find_package(GTest REQUIRED)
# -fexceptions
set(ABSL_EXCEPTIONS_FLAG "${CMAKE_CXX_EXCEPTIONS}")
@@ -70,9 +62,8 @@ set(ABSL_EXCEPTIONS_FLAG "${CMAKE_CXX_EXCEPTIONS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FIX_MSVC} ${CMAKE_CXX_FLAGS}")
list(APPEND ABSL_TEST_COMMON_LIBRARIES
- gtest_main
- gtest
- gmock
+ GTest::Main
+ GTest::GTest
${CMAKE_THREAD_LIBS_INIT}
)
diff --git a/Firestore/third_party/abseil-cpp/absl/CMakeLists.txt b/Firestore/third_party/abseil-cpp/absl/CMakeLists.txt
index 689f64e..fb158fa 100644
--- a/Firestore/third_party/abseil-cpp/absl/CMakeLists.txt
+++ b/Firestore/third_party/abseil-cpp/absl/CMakeLists.txt
@@ -17,14 +17,5 @@
add_subdirectory(base)
-add_subdirectory(algorithm)
-add_subdirectory(container)
-add_subdirectory(debugging)
-add_subdirectory(memory)
add_subdirectory(meta)
-add_subdirectory(numeric)
add_subdirectory(strings)
-add_subdirectory(synchronization)
-add_subdirectory(time)
-add_subdirectory(types)
-add_subdirectory(utility)
diff --git a/Firestore/third_party/abseil-cpp/absl/base/CMakeLists.txt b/Firestore/third_party/abseil-cpp/absl/base/CMakeLists.txt
index 3e94d51..a6cd1ff 100644
--- a/Firestore/third_party/abseil-cpp/absl/base/CMakeLists.txt
+++ b/Firestore/third_party/abseil-cpp/absl/base/CMakeLists.txt
@@ -16,57 +16,26 @@
list(APPEND BASE_PUBLIC_HEADERS
"attributes.h"
- "call_once.h"
- "casts.h"
"config.h"
"dynamic_annotations.h"
"macros.h"
"optimization.h"
"policy_checks.h"
"port.h"
- "thread_annotations.h"
)
list(APPEND BASE_INTERNAL_HEADERS
"internal/atomic_hook.h"
- "internal/cycleclock.h"
- "internal/endian.h"
- "internal/exception_testing.h"
- "internal/identity.h"
- "internal/invoke.h"
"internal/log_severity.h"
- "internal/low_level_alloc.h"
- "internal/low_level_scheduling.h"
- "internal/malloc_extension_c.h"
- "internal/malloc_extension.h"
- "internal/malloc_hook_c.h"
- "internal/malloc_hook.h"
- "internal/malloc_hook_invoke.h"
- "internal/per_thread_tls.h"
"internal/raw_logging.h"
- "internal/scheduling_mode.h"
- "internal/spinlock.h"
- "internal/spinlock_wait.h"
- "internal/sysinfo.h"
- "internal/thread_identity.h"
"internal/throw_delegate.h"
- "internal/tsan_mutex_interface.h"
- "internal/unaligned_access.h"
- "internal/unscaledcycleclock.h"
)
# absl_base main library
-list(APPEND BASE_SRC
- "internal/cycleclock.cc"
+list(APPEND BASE_SRC
"internal/raw_logging.cc"
- "internal/spinlock.cc"
- "internal/sysinfo.cc"
- "internal/thread_identity.cc"
- "internal/unscaledcycleclock.cc"
- "internal/low_level_alloc.cc"
- "internal/malloc_hook.cc"
${BASE_PUBLIC_HEADERS}
${BASE_INTERNAL_HEADERS}
)
@@ -78,25 +47,10 @@ absl_library(
${BASE_SRC}
PUBLIC_LIBRARIES
absl_dynamic_annotations
- absl_spinlock_wait
EXPORT_NAME
base
)
-# malloc extension library
-set(MALLOC_EXTENSION_SRC "internal/malloc_extension.cc")
-set(MALLOC_EXTENSION_PUBLIC_LIBRARIES absl::base)
-
-absl_library(
- TARGET
- absl_malloc_extension
- SOURCES
- ${MALLOC_EXTENSION_SRC}
- PUBLIC_LIBRARIES
- ${MALLOC_EXTENSION_PUBLIC_LIBRARIES}
- EXPORT_NAME
- malloc_extension
-)
# throw delegate library
set(THROW_DELEGATE_SRC "internal/throw_delegate.cc")
@@ -126,134 +80,13 @@ absl_library(
)
-# spinlock_wait library
-set(SPINLOCK_WAIT_SRC "internal/spinlock_wait.cc")
-
-absl_library(
- TARGET
- absl_spinlock_wait
- SOURCES
- ${SPINLOCK_WAIT_SRC}
-)
-
-
-# malloc_internal library
-list(APPEND MALLOC_INTERNAL_SRC
- "internal/low_level_alloc.cc"
- "internal/malloc_hook.cc"
- "internal/malloc_hook_mmap_linux.inc"
-)
-
-absl_library(
- TARGET
- absl_malloc_internal
- SOURCES
- ${MALLOC_INTERNAL_SRC}
- PUBLIC_LIBRARIES
- absl_dynamic_annotations
-)
-
-
-
#
## TESTS
#
-# call once test
-set(CALL_ONCE_TEST_SRC "call_once_test.cc")
-set(CALL_ONCE_TEST_PUBLIC_LIBRARIES absl::base absl::synchronization)
-
-absl_test(
- TARGET
- call_once_test
- SOURCES
- ${CALL_ONCE_TEST_SRC}
- PUBLIC_LIBRARIES
- ${CALL_ONCE_TEST_PUBLIC_LIBRARIES}
-)
-
-
-# test bit_cast_test
-set(BIT_CAST_TEST_SRC "bit_cast_test.cc")
-
-absl_test(
- TARGET
- bit_cast_test
- SOURCES
- ${BIT_CAST_TEST_SRC}
-)
-
-
-# test absl_throw_delegate_test
-set(THROW_DELEGATE_TEST_SRC "throw_delegate_test.cc")
-set(THROW_DELEGATE_TEST_PUBLIC_LIBRARIES absl::base absl_throw_delegate)
-
-absl_test(
- TARGET
- throw_delegate_test
- SOURCES
- ${THROW_DELEGATE_TEST_SRC}
- PUBLIC_LIBRARIES
- ${THROW_DELEGATE_TEST_PUBLIC_LIBRARIES}
-)
-
-
-# test invoke_test
-set(INVOKE_TEST_SRC "invoke_test.cc")
-set(INVOKE_TEST_PUBLIC_LIBRARIES absl::strings)
-
-absl_test(
- TARGET
- invoke_test
- SOURCES
- ${INVOKE_TEST_SRC}
- PUBLIC_LIBRARIES
- ${INVOKE_TEST_PUBLIC_LIBRARIES}
-)
-
-
-# test spinlock_test_common
-set(SPINLOCK_TEST_COMMON_SRC "spinlock_test_common.cc")
-set(SPINLOCK_TEST_COMMON_PUBLIC_LIBRARIES absl::base absl::synchronization)
-
-absl_test(
- TARGET
- spinlock_test_common
- SOURCES
- ${SPINLOCK_TEST_COMMON_SRC}
- PUBLIC_LIBRARIES
- ${SPINLOCK_TEST_COMMON_PUBLIC_LIBRARIES}
-)
-
-
-# test spinlock_test
-set(SPINLOCK_TEST_SRC "spinlock_test_common.cc")
-set(SPINLOCK_TEST_PUBLIC_LIBRARIES absl::base absl::synchronization)
-
-absl_test(
- TARGET
- spinlock_test
- SOURCES
- ${SPINLOCK_TEST_SRC}
- PUBLIC_LIBRARIES
- ${SPINLOCK_TEST_PUBLIC_LIBRARIES}
-)
-
-
-# test endian_test
-set(ENDIAN_TEST_SRC "internal/endian_test.cc")
-
-absl_test(
- TARGET
- endian_test
- SOURCES
- ${ENDIAN_TEST_SRC}
-)
-
-
# test config_test
set(CONFIG_TEST_SRC "config_test.cc")
-set(CONFIG_TEST_PUBLIC_LIBRARIES absl::base absl::synchronization)
+set(CONFIG_TEST_PUBLIC_LIBRARIES absl::base)
absl_test(
TARGET
config_test
@@ -276,66 +109,3 @@ absl_test(
PUBLIC_LIBRARIES
${RAW_LOGGING_TEST_PUBLIC_LIBRARIES}
)
-
-
-# test sysinfo_test
-set(SYSINFO_TEST_SRC "internal/sysinfo_test.cc")
-set(SYSINFO_TEST_PUBLIC_LIBRARIES absl::base absl::synchronization)
-
-absl_test(
- TARGET
- sysinfo_test
- SOURCES
- ${SYSINFO_TEST_SRC}
- PUBLIC_LIBRARIES
- ${SYSINFO_TEST_PUBLIC_LIBRARIES}
-)
-
-
-# test low_level_alloc_test
-set(LOW_LEVEL_ALLOC_TEST_SRC "internal/low_level_alloc_test.cc")
-set(LOW_LEVEL_ALLOC_TEST_PUBLIC_LIBRARIES absl::base)
-
-absl_test(
- TARGET
- low_level_alloc_test
- SOURCES
- ${LOW_LEVEL_ALLOC_TEST_SRC}
- PUBLIC_LIBRARIES
- ${LOW_LEVEL_ALLOC_TEST_PUBLIC_LIBRARIES}
-)
-
-
-# test thread_identity_test
-set(THREAD_IDENTITY_TEST_SRC "internal/thread_identity_test.cc")
-set(THREAD_IDENTITY_TEST_PUBLIC_LIBRARIES absl::base absl::synchronization)
-
-absl_test(
- TARGET
- thread_identity_test
- SOURCES
- ${THREAD_IDENTITY_TEST_SRC}
- PUBLIC_LIBRARIES
- ${THREAD_IDENTITY_TEST_PUBLIC_LIBRARIES}
-)
-
-
-# test absl_malloc_extension_system_malloc_test
-set(MALLOC_EXTENSION_SYSTEM_MALLOC_TEST_SRC "internal/malloc_extension_test.cc")
-set(MALLOC_EXTENSION_SYSTEM_MALLOC_TEST_PUBLIC_LIBRARIES absl::base absl_malloc_extension)
-set(MALLOC_EXTENSION_SYSTEM_MALLOC_TEST_PRIVATE_COMPILE_FLAGS "-DABSL_MALLOC_EXTENSION_TEST_ALLOW_MISSING_EXTENSION=1")
-
-absl_test(
- TARGET
- absl_malloc_extension_system_malloc_test
- SOURCES
- ${MALLOC_EXTENSION_SYSTEM_MALLOC_TEST_SRC}
- PUBLIC_LIBRARIES
- ${MALLOC_EXTENSION_SYSTEM_MALLOC_TEST_PUBLIC_LIBRARIES}
- PRIVATE_COMPILE_FLAGS
- ${MALLOC_EXTENSION_SYSTEM_MALLOC_TEST_PRIVATE_COMPILE_FLAGS}
-)
-
-
-
-
diff --git a/Firestore/third_party/abseil-cpp/absl/base/config_test.cc b/Firestore/third_party/abseil-cpp/absl/base/config_test.cc
index c839712..4e6dd6a 100644
--- a/Firestore/third_party/abseil-cpp/absl/base/config_test.cc
+++ b/Firestore/third_party/abseil-cpp/absl/base/config_test.cc
@@ -17,7 +17,6 @@
#include <cstdint>
#include "gtest/gtest.h"
-#include "absl/synchronization/internal/thread_pool.h"
namespace {
@@ -41,20 +40,4 @@ TEST(ConfigTest, Endianness) {
#endif
}
-#if defined(ABSL_HAVE_THREAD_LOCAL)
-TEST(ConfigTest, ThreadLocal) {
- static thread_local int mine_mine_mine = 16;
- EXPECT_EQ(16, mine_mine_mine);
- {
- absl::synchronization_internal::ThreadPool pool(1);
- pool.Schedule([&] {
- EXPECT_EQ(16, mine_mine_mine);
- mine_mine_mine = 32;
- EXPECT_EQ(32, mine_mine_mine);
- });
- }
- EXPECT_EQ(16, mine_mine_mine);
-}
-#endif
-
} // namespace
diff --git a/Firestore/third_party/abseil-cpp/absl/meta/CMakeLists.txt b/Firestore/third_party/abseil-cpp/absl/meta/CMakeLists.txt
index d56fced..a25dd61 100644
--- a/Firestore/third_party/abseil-cpp/absl/meta/CMakeLists.txt
+++ b/Firestore/third_party/abseil-cpp/absl/meta/CMakeLists.txt
@@ -44,6 +44,3 @@ absl_test(
PUBLIC_LIBRARIES
${TYPE_TRAITS_TEST_PUBLIC_LIBRARIES} absl::meta
)
-
-
-
diff --git a/Firestore/third_party/abseil-cpp/absl/strings/CMakeLists.txt b/Firestore/third_party/abseil-cpp/absl/strings/CMakeLists.txt
index dcd4974..070bf4f 100644
--- a/Firestore/third_party/abseil-cpp/absl/strings/CMakeLists.txt
+++ b/Firestore/third_party/abseil-cpp/absl/strings/CMakeLists.txt
@@ -17,27 +17,14 @@
list(APPEND STRINGS_PUBLIC_HEADERS
"ascii.h"
- "escaping.h"
"match.h"
- "numbers.h"
- "str_cat.h"
"string_view.h"
- "strip.h"
- "str_join.h"
- "str_replace.h"
- "str_split.h"
- "substitute.h"
)
list(APPEND STRINGS_INTERNAL_HEADERS
- "internal/char_map.h"
"internal/memutil.h"
- "internal/ostringstream.h"
"internal/resize_uninitialized.h"
- "internal/str_join_internal.h"
- "internal/str_split_internal.h"
- "internal/utf8.h"
)
@@ -45,17 +32,9 @@ list(APPEND STRINGS_INTERNAL_HEADERS
# add string library
list(APPEND STRINGS_SRC
"ascii.cc"
- "escaping.cc"
"internal/memutil.cc"
- "internal/memutil.h"
- "internal/utf8.cc"
"match.cc"
- "numbers.cc"
- "str_cat.cc"
- "str_replace.cc"
- "str_split.cc"
"string_view.cc"
- "substitute.cc"
${STRINGS_PUBLIC_HEADERS}
${STRINGS_INTERNAL_HEADERS}
)
@@ -91,20 +70,6 @@ absl_test(
)
-# test escaping_test
-set(ESCAPING_TEST_SRC "escaping_test.cc")
-set(ESCAPING_TEST_PUBLIC_LIBRARIES absl::strings absl::base)
-
-absl_test(
- TARGET
- escaping_test
- SOURCES
- ${ESCAPING_TEST_SRC}
- PUBLIC_LIBRARIES
- ${ESCAPING_TEST_PUBLIC_LIBRARIES}
-)
-
-
# test ascii_test
set(ASCII_TEST_SRC "ascii_test.cc")
set(ASCII_TEST_PUBLIC_LIBRARIES absl::strings)
@@ -133,20 +98,6 @@ absl_test(
)
-# test utf8_test
-set(UTF8_TEST_SRC "internal/utf8_test.cc")
-set(UTF8_TEST_PUBLIC_LIBRARIES absl::strings absl::base)
-
-absl_test(
- TARGET
- utf8_test
- SOURCES
- ${UTF8_TEST_SRC}
- PUBLIC_LIBRARIES
- ${UTF8_TEST_PUBLIC_LIBRARIES}
-)
-
-
# test string_view_test
set(STRING_VIEW_TEST_SRC "string_view_test.cc")
set(STRING_VIEW_TEST_PUBLIC_LIBRARIES absl::strings absl_throw_delegate absl::base)
@@ -161,59 +112,6 @@ absl_test(
)
-# test substitute_test
-set(SUBSTITUTE_TEST_SRC "substitute_test.cc")
-set(SUBSTITUTE_TEST_PUBLIC_LIBRARIES absl::strings absl::base)
-
-absl_test(
- TARGET
- substitute_test
- SOURCES
- ${SUBSTITUTE_TEST_SRC}
- PUBLIC_LIBRARIES
- ${SUBSTITUTE_TEST_PUBLIC_LIBRARIES}
-)
-
-
-# test str_replace_test
-set(STR_REPLACE_TEST_SRC "str_replace_test.cc")
-set(STR_REPLACE_TEST_PUBLIC_LIBRARIES absl::strings absl::base absl_throw_delegate)
-
-absl_test(
- TARGET
- str_replace_test
- SOURCES
- ${STR_REPLACE_TEST_SRC}
- PUBLIC_LIBRARIES
- ${STR_REPLACE_TEST_PUBLIC_LIBRARIES}
-)
-
-
-# test str_split_test
-set(STR_SPLIT_TEST_SRC "str_split_test.cc")
-set(STR_SPLIT_TEST_PUBLIC_LIBRARIES absl::strings absl::base absl_throw_delegate)
-
-absl_test(
- TARGET
- str_split_test
- SOURCES
- ${STR_SPLIT_TEST_SRC}
- PUBLIC_LIBRARIES
- ${STR_SPLIT_TEST_PUBLIC_LIBRARIES}
-)
-
-
-# test ostringstream_test
-set(OSTRINGSTREAM_TEST_SRC "internal/ostringstream_test.cc")
-
-absl_test(
- TARGET
- ostringstream_test
- SOURCES
- ${OSTRINGSTREAM_TEST_SRC}
-)
-
-
# test resize_uninitialized_test
set(RESIZE_UNINITIALIZED_TEST_SRC "internal/resize_uninitialized_test.cc")
@@ -223,77 +121,3 @@ absl_test(
SOURCES
${RESIZE_UNINITIALIZED_TEST_SRC}
)
-
-
-# test str_join_test
-set(STR_JOIN_TEST_SRC "str_join_test.cc")
-set(STR_JOIN_TEST_PUBLIC_LIBRARIES absl::strings)
-
-absl_test(
- TARGET
- str_join_test
- SOURCES
- ${STR_JOIN_TEST_SRC}
- PUBLIC_LIBRARIES
- ${STR_JOIN_TEST_PUBLIC_LIBRARIES}
-)
-
-
-# test str_cat_test
-set(STR_CAT_TEST_SRC "str_cat_test.cc")
-set(STR_CAT_TEST_PUBLIC_LIBRARIES absl::strings)
-
-absl_test(
- TARGET
- str_cat_test
- SOURCES
- ${STR_CAT_TEST_SRC}
- PUBLIC_LIBRARIES
- ${STR_CAT_TEST_PUBLIC_LIBRARIES}
-)
-
-
-# test numbers_test
-set(NUMBERS_TEST_SRC "numbers_test.cc")
-set(NUMBERS_TEST_PUBLIC_LIBRARIES absl::strings)
-
-absl_test(
- TARGET
- numbers_test
- SOURCES
- ${NUMBERS_TEST_SRC}
- PUBLIC_LIBRARIES
- ${NUMBERS_TEST_PUBLIC_LIBRARIES}
-)
-
-
-# test strip_test
-set(STRIP_TEST_SRC "strip_test.cc")
-set(STRIP_TEST_PUBLIC_LIBRARIES absl::strings)
-
-absl_test(
- TARGET
- strip_test
- SOURCES
- ${STRIP_TEST_SRC}
- PUBLIC_LIBRARIES
- ${STRIP_TEST_PUBLIC_LIBRARIES}
-)
-
-
-# test char_map_test
-set(CHAR_MAP_TEST_SRC "internal/char_map_test.cc")
-set(CHAR_MAP_TEST_PUBLIC_LIBRARIES absl::strings)
-
-absl_test(
- TARGET
- char_map_test
- SOURCES
- ${CHAR_MAP_TEST_SRC}
- PUBLIC_LIBRARIES
- ${CHAR_MAP_TEST_PUBLIC_LIBRARIES}
-)
-
-
-
-
diff --git a/cmake/external/abseil-cpp.cmake b/cmake/external/abseil-cpp.cmake
new file mode 100644
index 0000000..d29b7d5
--- /dev/null
+++ b/cmake/external/abseil-cpp.cmake
@@ -0,0 +1,35 @@
+# Copyright 2017 Google
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+include(ExternalProject)
+
+set(source_dir ${PROJECT_SOURCE_DIR}/Firestore/third_party/abseil-cpp)
+set(binary_dir ${PROJECT_BINARY_DIR}/Firestore/third_party/abseil-cpp)
+
+ExternalProject_Add(
+ abseil-cpp
+ DEPENDS googletest
+
+ PREFIX "${binary_dir}"
+ SOURCE_DIR "${source_dir}"
+ BINARY_DIR "${binary_dir}"
+
+ INSTALL_DIR "${FIREBASE_INSTALL_DIR}"
+ INSTALL_COMMAND ""
+ TEST_BEFORE_INSTALL ON
+
+ CMAKE_ARGS
+ -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+ -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+)
diff --git a/cmake/external/firestore.cmake b/cmake/external/firestore.cmake
index 5316873..dd37b51 100644
--- a/cmake/external/firestore.cmake
+++ b/cmake/external/firestore.cmake
@@ -19,7 +19,7 @@ set(binary_dir ${PROJECT_BINARY_DIR}/Firestore)
ExternalProject_Add(
Firestore
- DEPENDS googletest
+ DEPENDS googletest abseil-cpp
# Lay the binary directory out as if this were a subproject. This makes it
# possible to build and test in it directly.