From 0658be799b2937240ed9c17890cf5e4fb597eaeb Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Sun, 4 Feb 2024 13:11:26 +0530 Subject: [PATCH] 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, std::__ndk1::allocator> const&)) --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0f0b33e65..fe1652d6fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -288,6 +288,10 @@ target_link_libraries(openttd ) target_link_libraries(openttd_test PRIVATE openttd_lib) +if(ANDROID) + target_link_libraries(openttd_test PRIVATE log) +endif() + include(Catch) catch_discover_tests(openttd_test)