mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
tests: Only link against threading library if available
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -17,24 +17,28 @@ include_directories(
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(TORTURE_LINK_LIBRARIES
|
||||||
|
${CMOCKA_LIBRARY}
|
||||||
|
${LIBSSH_STATIC_LIBRARY}
|
||||||
|
${LIBSSH_LINK_LIBRARIES})
|
||||||
|
|
||||||
|
if (Threads_FOUND)
|
||||||
|
set(TORTURE_LINK_LIBRARIES
|
||||||
|
${TORTURE_LINK_LIBRARIES}
|
||||||
|
${LIBSSH_THREADS_STATIC_LIBRARY}
|
||||||
|
${LIBSSH_THREADS_LINK_LIBRARIES})
|
||||||
|
endif ()
|
||||||
|
|
||||||
# create test library
|
# create test library
|
||||||
add_library(${TORTURE_LIBRARY} STATIC cmdline.c torture.c)
|
add_library(${TORTURE_LIBRARY} STATIC cmdline.c torture.c)
|
||||||
target_link_libraries(${TORTURE_LIBRARY}
|
target_link_libraries(${TORTURE_LIBRARY}
|
||||||
${CMOCKA_LIBRARY}
|
${TORTURE_LINK_LIBRARIES}
|
||||||
${LIBSSH_STATIC_LIBRARY}
|
|
||||||
${LIBSSH_LINK_LIBRARIES}
|
|
||||||
${LIBSSH_THREADS_STATIC_LIBRARY}
|
|
||||||
${LIBSSH_THREADS_LINK_LIBRARIES}
|
|
||||||
${ARGP_LIBRARIES}
|
${ARGP_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
set(TEST_TARGET_LIBRARIES
|
set(TEST_TARGET_LIBRARIES
|
||||||
${TORTURE_LIBRARY}
|
${TORTURE_LIBRARY}
|
||||||
${CMOCKA_LIBRARY}
|
${TORTURE_LINK_LIBRARIES}
|
||||||
${LIBSSH_STATIC_LIBRARY}
|
|
||||||
${LIBSSH_LINK_LIBRARIES}
|
|
||||||
${LIBSSH_THREADS_STATIC_LIBRARY}
|
|
||||||
${LIBSSH_THREADS_LINK_LIBRARIES}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
add_subdirectory(unittests)
|
add_subdirectory(unittests)
|
||||||
|
|||||||
Reference in New Issue
Block a user