From 931fa8eb13922fab18c75caa75d915165cb07315 Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 12 Jul 2021 17:53:24 -0500 Subject: [PATCH] get everything building on OSX #195 --- CMakeLists.txt | 6 ++++++ src/demo/input.c | 6 +++++- src/poc/statepixel.c | 1 + src/poc/textplay.c | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c5f83d3a2..15585d642 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -510,6 +510,7 @@ target_include_directories(notcurses-info include "${CMAKE_REQUIRED_INCLUDES}" "${PROJECT_BINARY_DIR}/include" + "${TERMINFO_INCLUDE_DIRS}" ) target_link_libraries(notcurses-info PRIVATE @@ -618,6 +619,7 @@ target_include_directories(notcurses-tester "${CMAKE_REQUIRED_INCLUDES}" "${PROJECT_BINARY_DIR}/include" src/lib + "${TERMINFO_INCLUDE_DIRS}" ) target_link_libraries(notcurses-tester PRIVATE @@ -625,6 +627,10 @@ target_link_libraries(notcurses-tester "${unistring}" "${TERMINFO_LIBRARIES}" ) +target_link_directories(notcurses-tester + PRIVATE + "${TERMINFO_LIBRARY_DIRS}" +) add_test( NAME notcurses-tester COMMAND notcurses-tester -p ${CMAKE_CURRENT_SOURCE_DIR}/data --abort-after=1 diff --git a/src/demo/input.c b/src/demo/input.c index b9dbcdbce..47f2790ce 100644 --- a/src/demo/input.c +++ b/src/demo/input.c @@ -155,8 +155,12 @@ int input_dispatcher(struct notcurses* nc){ if(input_pipefds[0] >= 0){ return -1; } - // freebsd doesn't have eventfd :/ + // freebsd doesn't have eventfd :/ and apple doesn't even have pipe2() =[ =[ +#ifdef __APPLE__ + if(pipe(input_pipefds)){ +#else if(pipe2(input_pipefds, O_CLOEXEC | O_NONBLOCK)){ +#endif fprintf(stderr, "Error creating pipe (%s)\n", strerror(errno)); return -1; } diff --git a/src/poc/statepixel.c b/src/poc/statepixel.c index bbfefd1c8..dd2432887 100644 --- a/src/poc/statepixel.c +++ b/src/poc/statepixel.c @@ -1,6 +1,7 @@ #include #include #include +#include "compat/compat.h" // drag plane |t| across plane |n| at cell row |y| static int diff --git a/src/poc/textplay.c b/src/poc/textplay.c index 57ba703a1..c425a3d0f 100644 --- a/src/poc/textplay.c +++ b/src/poc/textplay.c @@ -1,5 +1,6 @@ #include #include +#include "compat/compat.h" #define GIG 1000000000ull static const uint32_t LOWCOLOR = 0x004080;