Skip to content

Commit e75fb8c

Browse files
Fix: Link Crypt32.lib for firebase_analytics_test on Windows
I've added Crypt32.lib to the dependencies of the firebase_analytics_test target in `analytics/tests/CMakeLists.txt` when building on Windows. This is to resolve a persistent LNK2019 error for _CryptBinaryToStringA@20, which occurs during the linking phase of firebase_analytics_test.obj. This change directly links the required system library at the test executable level.
1 parent 9171093 commit e75fb8c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

analytics/tests/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
# limitations under the License.
1414

1515

16-
16+
if(WIN32)
17+
set(ANALYTICS_TEST_PLATFORM_DEPS Crypt32.lib)
18+
else()
19+
set(ANALYTICS_TEST_PLATFORM_DEPS "")
20+
endif()
1721

1822
firebase_cpp_cc_test(
1923
firebase_analytics_test
@@ -23,6 +27,7 @@ firebase_cpp_cc_test(
2327
firebase_app_for_testing
2428
firebase_analytics
2529
firebase_testing
30+
${ANALYTICS_TEST_PLATFORM_DEPS}
2631
)
2732

2833
firebase_cpp_cc_test_on_ios(

0 commit comments

Comments
 (0)