toxcore/testing/CMakeLists.txt
iphydf 00ff078f91
cleanup: Use target_link_libraries directly in cmake.
Instead of using `target_link_modules`, which does magic that we no
longer need, because we only have 1 library we install, and all binaries
we build link statically because they need access to internal symbols.
2023-12-26 00:24:08 +00:00

27 lines
813 B
CMake

# Helpful code for tests and other utilities
set(misc_tools_SOURCES
misc_tools.c
misc_tools.h)
add_library(misc_tools STATIC ${misc_tools_SOURCES})
if(TARGET toxcore_static)
target_link_libraries(misc_tools PRIVATE toxcore_static)
else()
target_link_libraries(misc_tools PRIVATE toxcore_shared)
endif()
################################################################################
#
# :: Test programs
#
################################################################################
if(BUILD_MISC_TESTS)
add_executable(Messenger_test Messenger_test.c)
target_link_libraries(Messenger_test PRIVATE misc_tools)
if(TARGET toxcore_static)
target_link_libraries(Messenger_test PRIVATE toxcore_static)
else()
target_link_libraries(Messenger_test PRIVATE toxcore_shared)
endif()
endif()