mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
00ff078f91
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.
27 lines
813 B
CMake
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()
|