Merge pull request #531 from afh/afh-detect-darwin-nixpkgs

Detect Nixpkgs on Darwin and avoid linking statically against ncurses
This commit is contained in:
casey langen 2022-07-11 11:23:31 -07:00 committed by GitHub
commit 9077bb9fa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,9 +98,11 @@ else()
endif()
if (APPLE)
message(STATUS "[ncurses] detected Darwin, linking statically")
set(CURSES_LIBRARY_NAME "lib${CURSES_LIBRARY_NAME}.a")
set(PANEL_LIBRARY_NAME "lib${PANEL_LIBRARY_NAME}.a")
if (NOT DEFINED ENV{NIX_CC})
message(STATUS "[ncurses] detected Darwin, linking statically")
set(CURSES_LIBRARY_NAME "lib${CURSES_LIBRARY_NAME}.a")
set(PANEL_LIBRARY_NAME "lib${PANEL_LIBRARY_NAME}.a")
endif()
else()
message(STATUS "[ncurses] not Darwin! will attempt to link against libtinfo")
find_library(LIBTINFO NAMES tinfo)