From 9a340e5b8f3f9d5b8b27d7702bfe7650f7b915ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Thu, 23 Jul 2015 09:53:16 +0200 Subject: [PATCH] Fix build under FreeBSD --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bcb84ec..7714de8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,14 @@ find_package (PkgConfig REQUIRED) pkg_check_modules (libssl REQUIRED libssl libcrypto) pkg_check_modules (ncursesw ncursesw) +if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD") + # iconv() doesn't have to be present in libc + # FIXME: detect if we need the library independently on the platform + list (APPEND project_libraries iconv) + # Need this for SIGWINCH; our POSIX version macros make it undefined + add_definitions (-D__BSD_VISIBLE=1) +endif ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD") + # -lpthread is only there for debugging (gdb & errno) # -lrt is only for glibc < 2.17 list (APPEND project_libraries ${libssl_LIBRARIES} rt pthread)