@@ -61,6 +61,8 @@ option(FIREBASE_INCLUDE_STORAGE
6161
6262option (FIREBASE_CPP_BUILD_TESTS
6363 "Enable the Firebase C++ Build Tests." OFF )
64+ option (FIREBASE_CPP_BUILD_STUB_TESTS
65+ "Enable the Firebase C++ Build Stub Tests." OFF )
6466option (FIREBASE_FORCE_FAKE_SECURE_STORAGE
6567 "Disable use of platform secret store and use fake impl." OFF )
6668option (FIREBASE_CPP_BUILD_PACKAGE
@@ -107,7 +109,7 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_LIST_DIR}/cmake)
107109include (external_rules)
108110include (cpp_pack)
109111
110- if (FIREBASE_CPP_BUILD_TESTS)
112+ if (FIREBASE_CPP_BUILD_TESTS OR FIREBASE_CPP_BUILD_STUB_TESTS )
111113 enable_testing ()
112114 include (test_rules)
113115 # Copy the custom CTest file into the binary directory, so that it is used.
@@ -296,11 +298,13 @@ endif()
296298if (FIRESTORE_USE_EXTERNAL_CMAKE_BUILD)
297299 set (FIRESTORE_BINARY_DIR ${FIRESTORE_SOURCE_DIR} -build )
298300
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 ()
304308
305309 add_subdirectory (${FIRESTORE_SOURCE_DIR} ${FIRESTORE_BINARY_DIR} )
306310
@@ -328,9 +332,11 @@ else()
328332 add_external_library(flatbuffers)
329333endif ()
330334
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 ()
334340endif ()
335341
336342if ((FIREBASE_INCLUDE_DATABASE AND DESKTOP) AND NOT FIREBASE_INCLUDE_FIRESTORE)
@@ -525,7 +531,7 @@ add_subdirectory(ios_pod)
525531
526532# If we're building tests, we need to include the 'testing' folder before any
527533# of the tests actually get built.
528- if (FIREBASE_CPP_BUILD_TESTS)
534+ if (FIREBASE_CPP_BUILD_TESTS OR FIREBASE_CPP_BUILD_STUB_TESTS )
529535 add_subdirectory (testing)
530536endif ()
531537
0 commit comments