aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2015-05-05 19:09:51 +0200
committerAndreas Schneider <asn@cryptomilk.org>2015-05-05 19:09:51 +0200
commit3eaad77de2a9c751e56424f3c34afec943beb647 (patch)
tree9736988c6db21a14ae6cb0b8628824e19d715ff7
parent9244750a63c430a6a167ca433213ed4d4cfef2fb (diff)
downloadlibssh-3eaad77de2a9c751e56424f3c34afec943beb647.tar.gz
libssh-3eaad77de2a9c751e56424f3c34afec943beb647.tar.xz
libssh-3eaad77de2a9c751e56424f3c34afec943beb647.zip
tests: Only link against threading library if available
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--tests/CMakeLists.txt24
1 files changed, 14 insertions, 10 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 7cdb2c48..a775c3c2 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -17,24 +17,28 @@ include_directories(
${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
add_library(${TORTURE_LIBRARY} STATIC cmdline.c torture.c)
target_link_libraries(${TORTURE_LIBRARY}
- ${CMOCKA_LIBRARY}
- ${LIBSSH_STATIC_LIBRARY}
- ${LIBSSH_LINK_LIBRARIES}
- ${LIBSSH_THREADS_STATIC_LIBRARY}
- ${LIBSSH_THREADS_LINK_LIBRARIES}
+ ${TORTURE_LINK_LIBRARIES}
${ARGP_LIBRARIES}
)
set(TEST_TARGET_LIBRARIES
${TORTURE_LIBRARY}
- ${CMOCKA_LIBRARY}
- ${LIBSSH_STATIC_LIBRARY}
- ${LIBSSH_LINK_LIBRARIES}
- ${LIBSSH_THREADS_STATIC_LIBRARY}
- ${LIBSSH_THREADS_LINK_LIBRARIES}
+ ${TORTURE_LINK_LIBRARIES}
)
add_subdirectory(unittests)