File tree Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 25
25
- clearlinux:latest
26
26
- gentoo/stage3:musl-hardened
27
27
- gentoo/stage3:hardened
28
+ - freebsd
28
29
config :
29
30
- cmake_args : " -DENABLE_API=ON -DCMAKE_C_COMPILER=gcc"
30
31
- cmake_args : " -DENABLE_API=ON -DCMAKE_C_COMPILER=clang"
52
53
${{ matrix.os }}/pkg-cache/
53
54
54
55
- name : Build inside Docker
56
+ if : " !startsWith(matrix.os, 'freebsd')"
55
57
id : docker-build
56
58
run : |
57
59
PKG_CACHE_DIR=/pkg-cache
@@ -167,3 +169,22 @@ jobs:
167
169
with :
168
170
path : pkg-cache
169
171
key : ${{ matrix.os }}/pkg-cache/${{ matrix.config.cmake_args }}/${{ github.sha }}
172
+
173
+ - name : Build inside FreeBSD VM
174
+ if : startsWith(matrix.os, 'freebsd')
175
+ uses : vmactions/freebsd-vm@v1
176
+ with :
177
+ prepare : |
178
+ PACKAGES="git cmake pkgconf curl jansson libsodium libmicrohttpd argp-standalone libepoll-shim"
179
+ if echo "${{ matrix.config.cmake_args }}" | grep -q "CMAKE_C_COMPILER=gcc"; then
180
+ PACKAGES="$PACKAGES gcc"
181
+ fi
182
+ pkg install -y $PACKAGES
183
+
184
+ run : |
185
+ git config --global --add safe.directory ${{ github.workspace }}
186
+ mkdir -p build
187
+ cd build
188
+ cmake ${{ github.workspace }} -DCMAKE_C_FLAGS='-Wall -Werror' ${{ matrix.config.cmake_args }}
189
+ make
190
+ ./datum_gateway --help
Original file line number Diff line number Diff line change @@ -76,11 +76,24 @@ set(ARGP_LIBS "")
76
76
check_function_exists (argp_parse HAVE_ARGP_PARSE )
77
77
if (NOT HAVE_ARGP_PARSE )
78
78
check_library_exists (argp argp_parse "" ARGP )
79
+ if (NOT ARGP AND CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" )
80
+ # Workaround bug where CMake doesn't check the standard install location on FreeBSD
81
+ unset (ARGP CACHE )
82
+ check_library_exists (argp argp_parse "/usr/local/lib" ARGP )
83
+ endif ()
79
84
if (ARGP )
80
85
list (APPEND ARGP_LIBS "argp" )
81
86
endif ()
82
87
endif ()
83
88
89
+ check_function_exists (epoll_wait HAVE_EPOLL_WAIT )
90
+ if (HAVE_EPOLL_WAIT )
91
+ set (EPOLL_SHIM_INCLUDE_DIRS "" )
92
+ set (EPOLL_SHIM_LIBRARIES "" )
93
+ else ()
94
+ pkg_check_modules (EPOLL_SHIM REQUIRED epoll-shim )
95
+ endif ()
96
+
84
97
cmake_pop_check_state ()
85
98
86
99
add_custom_target (generate_git_version
@@ -102,6 +115,7 @@ add_custom_command(
102
115
target_include_directories (datum_gateway
103
116
PRIVATE
104
117
$< BUILD_INTERFACE:${PROJECT_BINARY_DIR} >
118
+ ${EPOLL_SHIM_INCLUDE_DIRS}
105
119
${CURL_INCLUDE_DIRS}
106
120
${JANSSON_INCLUDE_DIRS}
107
121
${SODIUM_INCLUDE_DIRS}
@@ -117,6 +131,7 @@ target_link_libraries(datum_gateway
117
131
${POW_LIBS}
118
132
Threads::Threads
119
133
${ARGP_LIBS}
134
+ ${EPOLL_SHIM_LIBRARIES}
120
135
${CURL_LIBRARIES} ${CURL_LDFLAGS} ${CURL_LDFLAGS_OTHER}
121
136
${JANSSON_LIBRARIES} ${JANSSON_LDFLAGS} ${JANSSON_LDFLAGS_OTHER}
122
137
${SODIUM_LIBRARIES} ${SODIUM_LDFLAGS} ${SODIUM_LDFLAGS_OTHER}
Original file line number Diff line number Diff line change @@ -122,6 +122,10 @@ For Clear Linux:
122
122
123
123
sudo swupd bundle-add c-basic cmake pkgconf devpkg-curl devpkg-jansson devpkg-libsodium devpkg-libmicrohttpd psmisc
124
124
125
+ For FreeBSD:
126
+
127
+ sudo pkg install cmake pkgconf curl jansson libsodium libmicrohttpd argp-standalone libepoll-shim
128
+
125
129
Compile DATUM by running:
126
130
127
131
cmake . && make
Original file line number Diff line number Diff line change 63
63
#include <sys/time.h>
64
64
#include <pthread.h>
65
65
#include <netinet/tcp.h>
66
+ #include <netinet/in.h>
66
67
#include <inttypes.h>
67
68
68
69
#include "datum_utils.h"
You can’t perform that action at this time.
0 commit comments