From e24827a95a9e6608b14d1a0a92f42f34faa050fd Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Mon, 11 Jul 2022 15:16:03 +0200 Subject: [PATCH] Detect Nixpkgs on Darwin and avoid linking statically against ncurses. --- src/musikcube/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/musikcube/CMakeLists.txt b/src/musikcube/CMakeLists.txt index f42748aa2..802666c0a 100644 --- a/src/musikcube/CMakeLists.txt +++ b/src/musikcube/CMakeLists.txt @@ -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)