From ec6ac23ebc53c88ca58a416bffdb5bbb7956bd66 Mon Sep 17 00:00:00 2001 From: Shahar Mike Date: Tue, 7 Jan 2025 15:05:50 +0200 Subject: [PATCH] chore: fix build on FreeBSD (#4412) * chore: build on FreeBSD * docs * older helio --- docs/build-from-source.md | 6 ++++++ helio | 2 +- src/CMakeLists.txt | 2 +- src/redis/debug.c | 4 +++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/build-from-source.md b/docs/build-from-source.md index 2c623ff87..26f7be821 100644 --- a/docs/build-from-source.md +++ b/docs/build-from-source.md @@ -34,6 +34,12 @@ sudo zypper install automake boost-devel gcc-c++ git cmake libtool ninja libzstd libboost_context-devel libboost_system-devel ``` +On FreeBSD: + +```bash +pkg install -y git bash cmake ninja libunwind boost-libs autoconf automake libtool gmake bison +``` + ## Step 2 - clone the project ```bash diff --git a/helio b/helio index b508ad516..51f9c8b91 160000 --- a/helio +++ b/helio @@ -1 +1 @@ -Subproject commit b508ad51624c4470292f132de945449ddf2da998 +Subproject commit 51f9c8b913b44cff65c7bebe0da19a5257f5070b diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e3db36395..b0611d0dc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -45,7 +45,7 @@ function(gen_bison name) set_source_files_properties(${name}.cc ${name}_base.h PROPERTIES GENERATED TRUE) endfunction() -if (APPLE) +if (APPLE OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") set(SED_REPL sed "-i" '') else() set(SED_REPL sed "-i") diff --git a/src/redis/debug.c b/src/redis/debug.c index 23b074887..6e5c694e0 100644 --- a/src/redis/debug.c +++ b/src/redis/debug.c @@ -62,8 +62,10 @@ void _serverPanic(const char *file, int line, const char *msg, ...) { serverLog(LL_WARNING, "!!! Software Failure. Press left mouse button to continue"); serverLog(LL_WARNING, "Guru Meditation: %s #%s:%d", fmtmsg,file,line); #ifndef NDEBUG -#ifdef __APPLE__ +#if defined(__APPLE__) __assert_rtn(msg, file, line, ""); +#elif defined(__FreeBSD__) + __assert("", file, line, msg); #else __assert_fail(msg, file, line, ""); #endif