Skip to content

Commit ec18d0c

Browse files
committed
Hide the instance id desktop implementation behind a feature flag in open source
PiperOrigin-RevId: 275555534
1 parent bed71fc commit ec18d0c

File tree

8 files changed

+16
-7
lines changed

8 files changed

+16
-7
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ option(FIREBASE_CPP_BUILD_TESTS
4444
"Enable the Firebase C++ Build Tests." OFF)
4545
option(FIREBASE_FORCE_FAKE_SECURE_STORAGE
4646
"Disable use of platform secret store and use fake impl." OFF)
47+
option(FIREBASE_INSTANCE_ID_DESKTOP
48+
"Use the experimental Instance Id desktop implementation." OFF)
4749

4850
if(WIN32)
4951
# Turn on the use of the __cplusplus compiler define that is used to detect if

app/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,9 @@ endif()
373373
if (NOT ANDROID AND NOT IOS)
374374
# Add the rest subdirectory, so that other libraries can access it
375375
add_subdirectory(rest)
376-
add_subdirectory(instance_id)
376+
if (FIREBASE_INSTANCE_ID_DESKTOP)
377+
add_subdirectory(instance_id)
378+
endif()
377379
endif()
378380

379381
if(FIREBASE_CPP_BUILD_TESTS)

instance_id/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ else()
5555
"${desktop_SRCS}")
5656
endif()
5757

58-
if(ANDROID OR IOS OR use_stub)
58+
if(ANDROID OR IOS OR use_stub OR NOT FIREBASE_INSTANCE_ID_DESKTOP)
5959
set(additional_link_LIB)
6060
else()
6161
set(additional_link_LIB

remote_config/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,14 @@ else()
8181
${FLATBUFFERS_SOURCE_DIR}/include
8282
${NANOPB_INCLUDE_DIRS}
8383
${PROJECT_BINARY_DIR}/..)
84+
if(FIREBASE_INSTANCE_ID_DESKTOP)
85+
set(iid_desktop firebase_instance_id_desktop_impl)
86+
else()
87+
set(iid_desktop)
88+
endif()
8489
set(additional_link_LIB
8590
firebase_rest_lib
86-
firebase_instance_id_desktop_impl
91+
${iid_desktop}
8792
flatbuffers)
8893
endif()
8994

test_linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ cd linux_build
2727

2828
# Configure cmake with tests enabled
2929
# and disable use of libsecret due to not working on kokoro builders
30-
cmake .. -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON
30+
cmake .. -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON -DFIREBASE_INSTANCE_ID_DESKTOP=ON
3131

3232
# Build the SDK and the tests
3333
cmake --build .

test_mac_x64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ cd mac_x64_build
2727

2828
# Configure cmake with tests enabled
2929
# and disable use of libsecret due to not working on kokoro builders
30-
cmake .. -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON
30+
cmake .. -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON -DFIREBASE_INSTANCE_ID_DESKTOP=ON
3131

3232
# Build the SDK and the tests
3333
cmake --build .

test_windows_x32.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ EXIT /B %status%
4747
mkdir windows_%~1
4848
pushd windows_%~1
4949

50-
cmake .. -DFIREBASE_CPP_BUILD_TESTS=ON -DPROTOBUF_SRC_ROOT_FOLDER=%PROTOBUF_SRC_ROOT_FOLDER% -DOPENSSL_ROOT_DIR="%~2" %~3
50+
cmake .. -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_INSTANCE_ID_DESKTOP=ON -DPROTOBUF_SRC_ROOT_FOLDER=%PROTOBUF_SRC_ROOT_FOLDER% -DOPENSSL_ROOT_DIR="%~2" %~3
5151

5252
:: Check for errors, and return if there were any
5353
if %errorlevel% neq 0 (

test_windows_x64.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ EXIT /B %status%
4747
mkdir windows_%~1
4848
pushd windows_%~1
4949

50-
cmake .. -DFIREBASE_CPP_BUILD_TESTS=ON -DPROTOBUF_SRC_ROOT_FOLDER=%PROTOBUF_SRC_ROOT_FOLDER% -DOPENSSL_ROOT_DIR="%~2" %~3
50+
cmake .. -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_INSTANCE_ID_DESKTOP=ON -DPROTOBUF_SRC_ROOT_FOLDER=%PROTOBUF_SRC_ROOT_FOLDER% -DOPENSSL_ROOT_DIR="%~2" %~3
5151

5252
:: Check for errors, and return if there were any
5353
if %errorlevel% neq 0 (

0 commit comments

Comments
 (0)