CMakeLists.txt: fix macOS build
This commit is contained in:
parent
f9848ed627
commit
851c2ee548
|
@ -61,6 +61,8 @@ if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
|
||||||
# Need this for SIGWINCH in FreeBSD and OpenBSD respectively;
|
# Need this for SIGWINCH in FreeBSD and OpenBSD respectively;
|
||||||
# our POSIX version macros make it undefined
|
# our POSIX version macros make it undefined
|
||||||
add_definitions (-D__BSD_VISIBLE=1 -D_BSD_SOURCE=1)
|
add_definitions (-D__BSD_VISIBLE=1 -D_BSD_SOURCE=1)
|
||||||
|
elseif (APPLE)
|
||||||
|
add_definitions (-D_DARWIN_C_SOURCE)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# -lrt is only for glibc < 2.17
|
# -lrt is only for glibc < 2.17
|
||||||
|
@ -116,10 +118,16 @@ endif ()
|
||||||
if ((WANT_READLINE AND WANT_LIBEDIT) OR (NOT WANT_READLINE AND NOT WANT_LIBEDIT))
|
if ((WANT_READLINE AND WANT_LIBEDIT) OR (NOT WANT_READLINE AND NOT WANT_LIBEDIT))
|
||||||
message (SEND_ERROR "You have to choose either GNU Readline or libedit")
|
message (SEND_ERROR "You have to choose either GNU Readline or libedit")
|
||||||
elseif (WANT_READLINE)
|
elseif (WANT_READLINE)
|
||||||
|
pkg_check_modules (readline readline)
|
||||||
|
|
||||||
# OpenBSD's default readline is too old
|
# OpenBSD's default readline is too old
|
||||||
if ("${CMAKE_SYSTEM_NAME}" MATCHES "OpenBSD")
|
if ("${CMAKE_SYSTEM_NAME}" MATCHES "OpenBSD")
|
||||||
include_directories (${OPENBSD_LOCALBASE}/include/ereadline)
|
include_directories (${OPENBSD_LOCALBASE}/include/ereadline)
|
||||||
list (APPEND xC_libraries ereadline)
|
list (APPEND xC_libraries ereadline)
|
||||||
|
elseif (readline_FOUND)
|
||||||
|
list (APPEND xC_libraries ${readline_LIBRARIES})
|
||||||
|
include_directories (${readline_INCLUDE_DIRS})
|
||||||
|
link_directories (${readline_LIBRARY_DIRS})
|
||||||
else ()
|
else ()
|
||||||
list (APPEND xC_libraries readline)
|
list (APPEND xC_libraries readline)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
Loading…
Reference in New Issue