1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-24 19:37:48 +03:00
Files
libssh/tests/server/test_server/CMakeLists.txt
Jakub Jelen 64ef3fefb4 Rework the coverage build
This reworks it to avoid a need to special build type and adding the flags only
to the targets that need it (skipping testing wrappers which break with them).

It also updates the CodeCoverage module from the following URL:

https://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmake

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2024-03-08 13:34:23 +01:00

42 lines
1014 B
CMake

project(test_server C)
if (WITH_SERVER AND UNIX AND NOT WIN32)
find_package(socket_wrapper)
set(server_SRCS
main.c
)
add_library(testserver STATIC
test_server.c
default_cb.c
sftpserver_cb.c)
if (WITH_COVERAGE)
append_coverage_compiler_flags_to_target(testserver)
endif (WITH_COVERAGE)
set(LIBSSH_SERVER_TESTS
# torture_server_kbdint
)
include_directories(${libssh_SOURCE_DIR}/include
${libssh_BINARY_DIR}/include
${libssh_BINARY_DIR})
if (ARGP_INCLUDE_DIR)
include_directories(${ARGP_INCLUDE_DIR})
endif ()
if (UNIX AND NOT WIN32)
add_executable(test_server ${server_SRCS})
target_compile_options(test_server PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
target_link_libraries(test_server
PRIVATE testserver ssh::ssh ${ARGP_LIBRARIES} util)
if (WITH_COVERAGE)
append_coverage_compiler_flags_to_target(test_server)
endif (WITH_COVERAGE)
endif ()
endif (WITH_SERVER AND UNIX AND NOT WIN32)