1
0
Fork 0

Fix: [CMake] Link test executable with log library in Android

This fixes the following compiler error.

ld.lld: error: undefined symbol: __android_log_write
referenced by test_main.cpp
CMakeFiles/openttd_test.dir/src/tests/test_main.cpp.o:
(Catch::writeToDebugConsole(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&))
pull/11979/head
Biswapriyo Nath 2024-02-04 13:11:26 +05:30
parent cb13ee90ef
commit 0658be799b
1 changed files with 4 additions and 0 deletions

View File

@ -288,6 +288,10 @@ target_link_libraries(openttd
) )
target_link_libraries(openttd_test PRIVATE openttd_lib) target_link_libraries(openttd_test PRIVATE openttd_lib)
if(ANDROID)
target_link_libraries(openttd_test PRIVATE log)
endif()
include(Catch) include(Catch)
catch_discover_tests(openttd_test) catch_discover_tests(openttd_test)