From 45c25e3cbc2e1a96db4ad9a89dd538d162eef47c Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Mon, 26 Oct 2020 11:13:52 +0200 Subject: [PATCH] Made lib-recode optional. See: https://github.com/shlomif/fortune-mod/issues/44 --- fortune-mod/CMakeLists.txt | 2 +- fortune-mod/fortune/fortune.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fortune-mod/CMakeLists.txt b/fortune-mod/CMakeLists.txt index f032bee..1b325cb 100644 --- a/fortune-mod/CMakeLists.txt +++ b/fortune-mod/CMakeLists.txt @@ -150,7 +150,7 @@ SET(_r "stdbool.h" "stdio.h" "recode.h") CHECK_INCLUDE_FILES("${_r}" HAVE_RECODE_H) IF (NOT "${HAVE_RECODE_H}") IF (NOT WIN32) - MESSAGE(FATAL_ERROR "Cannot find recode.h anywhere - please install lib recode") + MESSAGE(WARNING "Cannot find recode.h anywhere - for an improved user experience please install the recode library: https://github.com/rrthomas/recode") ENDIF () ENDIF () diff --git a/fortune-mod/fortune/fortune.c b/fortune-mod/fortune/fortune.c index 37a5d3e..e332f01 100644 --- a/fortune-mod/fortune/fortune.c +++ b/fortune-mod/fortune/fortune.c @@ -89,8 +89,10 @@ #ifndef _WIN32 #include #define O_BINARY 0 +#ifdef HAVE_RECODE_H #define WITH_RECODE #endif +#endif #ifdef WITH_RECODE #include #endif -- 2.40.0