From f69a9dab33e262c9e861dcc580d0626f319bb039 Mon Sep 17 00:00:00 2001 From: Lucas Holt Date: Tue, 5 Nov 2024 11:17:23 -0500 Subject: [PATCH] CMake: Add initial support for MidnightBSD (#1377) * Add initial support for MidnightBSD * Cleanup some issues identified through code review. Add libzfs check as MidnightBSD does have zfs. * Add MidnightBSD check to the version.c detection * Remove `OR MidnightBSD` tests * Clean up --------- Co-authored-by: Carter Li --- CMakeLists.txt | 3 +++ src/detection/version/version.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc33bf5be..8f60c39b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,9 @@ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") set(FreeBSD TRUE CACHE BOOL "..." FORCE) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD") set(OpenBSD TRUE CACHE BOOL "..." FORCE) +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "MidnightBSD") + set(FreeBSD TRUE CACHE BOOL "..." FORCE) + set(MidnightBSD TRUE CACHE BOOL "..." FORCE) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "NetBSD") set(NetBSD TRUE CACHE BOOL "..." FORCE) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly") diff --git a/src/detection/version/version.c b/src/detection/version/version.c index 8b230eecb..1f1deb348 100644 --- a/src/detection/version/version.c +++ b/src/detection/version/version.c @@ -28,6 +28,8 @@ #define FF_SYSNAME "Linux" #elif defined(__DragonFly__) // We define `__FreeBSD__` on DragonFly BSD for simplification #define FF_SYSNAME "DragonFly" +#elif defined(__MidnightBSD__) + #define FF_SYSNAME "MidnightBSD" #elif defined(__FreeBSD__) #define FF_SYSNAME "FreeBSD" #elif defined(__APPLE__)