From b15ec36e38a501ad460f95956722af58fa762dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Wed, 28 Jun 2023 16:27:34 +0200 Subject: CMakeLists.txt: fix build on BSD and macOS --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c75bc06..7fa3e12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,6 +79,14 @@ include_directories (${Unistring_INCLUDE_DIRS} ${Ncursesw_INCLUDE_DIRS} ${Termo_INCLUDE_DIRS}) # Configuration +if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD") + # Need this for SIGWINCH in FreeBSD and OpenBSD respectively; + # our POSIX version macros make it undefined + add_definitions (-D__BSD_VISIBLE=1 -D_BSD_SOURCE=1) +elseif (APPLE) + add_definitions (-D_DARWIN_C_SOURCE) +endif () + include (CheckFunctionExists) set (CMAKE_REQUIRED_LIBRARIES ${Ncursesw_LIBRARIES}) CHECK_FUNCTION_EXISTS ("resizeterm" HAVE_RESIZETERM) -- cgit v1.2.3