@@ -61,6 +61,8 @@ option(FIREBASE_INCLUDE_STORAGE
61
61
62
62
option (FIREBASE_CPP_BUILD_TESTS
63
63
"Enable the Firebase C++ Build Tests." OFF )
64
+ option (FIREBASE_CPP_BUILD_STUB_TESTS
65
+ "Enable the Firebase C++ Build Stub Tests." OFF )
64
66
option (FIREBASE_FORCE_FAKE_SECURE_STORAGE
65
67
"Disable use of platform secret store and use fake impl." OFF )
66
68
option (FIREBASE_CPP_BUILD_PACKAGE
@@ -107,7 +109,7 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_LIST_DIR}/cmake)
107
109
include (external_rules )
108
110
include (cpp_pack )
109
111
110
- if (FIREBASE_CPP_BUILD_TESTS )
112
+ if (FIREBASE_CPP_BUILD_TESTS OR FIREBASE_CPP_BUILD_STUB_TESTS )
111
113
enable_testing ()
112
114
include (test_rules )
113
115
# Copy the custom CTest file into the binary directory, so that it is used.
@@ -296,11 +298,13 @@ endif()
296
298
if (FIRESTORE_USE_EXTERNAL_CMAKE_BUILD )
297
299
set (FIRESTORE_BINARY_DIR ${FIRESTORE_SOURCE_DIR} -build )
298
300
299
- set (
300
- FIREBASE_IOS_BUILD_TESTS
301
- ${FIREBASE_CPP_BUILD_TESTS}
302
- CACHE BOOL "Force Firestore build tests to match"
303
- )
301
+ if (FIREBASE_CPP_BUILD_TESTS OR FIREBASE_CPP_BUILD_STUB_TESTS )
302
+ set (FIREBASE_IOS_BUILD_TESTS ON
303
+ CACHE BOOL "Force Firestore build tests to match" )
304
+ else ()
305
+ set (FIREBASE_IOS_BUILD_TESTS OFF
306
+ CACHE BOOL "Force Firestore build tests to match" )
307
+ endif ()
304
308
305
309
add_subdirectory (${FIRESTORE_SOURCE_DIR} ${FIRESTORE_BINARY_DIR} )
306
310
@@ -328,9 +332,11 @@ else()
328
332
add_external_library (flatbuffers )
329
333
endif ()
330
334
331
- if (FIREBASE_CPP_BUILD_TESTS AND NOT FIRESTORE_USE_EXTERNAL_CMAKE_BUILD )
332
- # Firestore's external build pulls in GoogleTest
333
- add_external_library (googletest )
335
+ if (FIREBASE_CPP_BUILD_TESTS OR FIREBASE_CPP_BUILD_STUB_TESTSAND )
336
+ if (NOT FIRESTORE_USE_EXTERNAL_CMAKE_BUILD )
337
+ # Firestore's external build pulls in GoogleTest
338
+ add_external_library (googletest )
339
+ endif ()
334
340
endif ()
335
341
336
342
if ((FIREBASE_INCLUDE_DATABASE AND DESKTOP ) AND NOT FIREBASE_INCLUDE_FIRESTORE )
@@ -525,7 +531,7 @@ add_subdirectory(ios_pod)
525
531
526
532
# If we're building tests, we need to include the 'testing' folder before any
527
533
# of the tests actually get built.
528
- if (FIREBASE_CPP_BUILD_TESTS )
534
+ if (FIREBASE_CPP_BUILD_TESTS OR FIREBASE_CPP_BUILD_STUB_TESTS )
529
535
add_subdirectory (testing )
530
536
endif ()
531
537
0 commit comments