Skip to content

Commit

Permalink
cmake: build libhostname for test suite
Browse files Browse the repository at this point in the history
Used by some test cases via LD_PRELOAD in order to fake the host name.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
  • Loading branch information
Lekensteyn authored and bagder committed Nov 10, 2014
1 parent 10286f4 commit 767aaf5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/libtest/CMakeLists.txt
Expand Up @@ -35,6 +35,15 @@ foreach(TEST_NAME ${noinst_PROGRAMS})
setup_test(${TEST_NAME} ${${TEST_NAME}_SOURCES})
endforeach()

# Allows for hostname override to make tests machine independent.
# TODO this cmake build assumes a shared build, detect static linking here!
if(NOT WIN32)
add_library(hostname MODULE sethostname.c sethostname.h)
# Output to .libs for compatibility with autotools, the test data expects a
# library at (tests)/libtest/.libs/libhostname.so
set_target_properties(hostname PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.libs)
endif()

# # files used only in some libcurl test programs
# SET(TESTUTIL testutil.c testutil.h)
Expand Down

0 comments on commit 767aaf5

Please sign in to comment.