From 56189f80b43e9deafaf8b869f553fdf30a7725b3 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Tue, 20 Feb 2024 17:40:01 -0500 Subject: [PATCH] port to freebsd --- CMakePresets.json | 15 +++++++++++++++ inc_internal/metrics.h | 2 +- library/endian_internal.h | 2 +- library/utils.c | 2 ++ tests/zitilib-tests.cpp | 1 + 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 3a731a62..2fc56eda 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -167,6 +167,21 @@ "VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/toolchains/Linux-arm.cmake" } }, + { + "name": "ci-freebsd-x64", + "inherits": [ + "ci-build", + "ci-unix", + "dev-mode", + "vcpkg" + ], + "cacheVariables": { + "CMAKE_MAKE_PROGRAM": "ninja", + "CMAKE_C_COMPILER": "clang", + "CMAKE_CXX_COMPILER": "clang++", + "VCPKG_TARGET_TRIPLET": "x64-freebsd" + } + }, { "name": "ci-windows-x64", "inherits": [ diff --git a/inc_internal/metrics.h b/inc_internal/metrics.h index 0c2c0bfc..f210ab0b 100644 --- a/inc_internal/metrics.h +++ b/inc_internal/metrics.h @@ -25,7 +25,7 @@ #include using namespace std; #else -#if defined(__linux) +#if defined(__linux) || defined(__FreeBSD__) /* 20230621:NFRAGALE@NETFOUNDRY:Build assurance against a missing macro in features.h. */ # if defined __GNUC__ && defined __GNUC_MINOR__ && ! __clang__ diff --git a/library/endian_internal.h b/library/endian_internal.h index 284bf078..d1967051 100644 --- a/library/endian_internal.h +++ b/library/endian_internal.h @@ -20,7 +20,7 @@ #endif -#if defined(__linux__) +#if defined(__linux__) || defined(__FreeBSD__) # include #elif defined (__APPLE__) # include diff --git a/library/utils.c b/library/utils.c index 33ec1bab..1bf0e533 100644 --- a/library/utils.c +++ b/library/utils.c @@ -45,6 +45,8 @@ #define ZITI_OS Android #elif defined(__linux__) #define ZITI_OS Linux +#elif defined(__FreeBSD__) +#define ZITI_OS FreeBSD #elif defined(__APPLE__) #define ZITI_OS MacOS #else diff --git a/tests/zitilib-tests.cpp b/tests/zitilib-tests.cpp index c1a1a895..a5f790c2 100644 --- a/tests/zitilib-tests.cpp +++ b/tests/zitilib-tests.cpp @@ -23,6 +23,7 @@ #if _WIN32 #else #include +#include #endif class testRunListener : public Catch::EventListenerBase {