aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-06-28 16:27:34 +0200
committerPřemysl Eric Janouch <p@janouch.name>2023-06-28 16:27:34 +0200
commitb15ec36e38a501ad460f95956722af58fa762dc6 (patch)
treebe74f0ae0c940fdaa5e09116781070cf51873cc5
parentb000f5eca73e014b2a8c596fe429768726b86463 (diff)
downloadhex-b15ec36e38a501ad460f95956722af58fa762dc6.tar.gz
hex-b15ec36e38a501ad460f95956722af58fa762dc6.tar.xz
hex-b15ec36e38a501ad460f95956722af58fa762dc6.zip
CMakeLists.txt: fix build on BSD and macOS
-rw-r--r--CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
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)