File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # SPDX-License-Identifier: BSD-3-Clause
2+ # Copyright (c) Contributors to the OpenEXR Project.
3+ #
4+ # Build and test on FreeBSD using a community VM action.
5+ # GitHub does not provide native FreeBSD runners; this uses vmactions/freebsd-vm.
6+ # Validates the pthread fallback in internal_thread.h (issue #2299).
7+
8+ name : CI (FreeBSD)
9+
10+ on :
11+ push :
12+ paths :
13+ - ' **'
14+ - ' !**.md'
15+ - ' !website/**'
16+ - ' !bazel/**'
17+ - ' !src/wrappers/**'
18+ - ' !.github/workflows/**'
19+ - ' .github/workflows/ci_freebsd.yml'
20+ pull_request :
21+ paths :
22+ - ' **'
23+ - ' !**.md'
24+ - ' !website/**'
25+ - ' !bazel/**'
26+ - ' !src/wrappers/**'
27+ - ' !.github/workflows/**'
28+ - ' .github/workflows/ci_freebsd.yml'
29+
30+ permissions :
31+ contents : read
32+
33+ jobs :
34+ freebsd :
35+ name : FreeBSD
36+ runs-on : ubuntu-latest
37+ steps :
38+ - name : Build and test on FreeBSD
39+ uses : vmactions/freebsd-vm@4807432c7cab1c3f97688665332c0b932062d31f # v1
40+ with :
41+ release : ' 15.0'
42+ envs : GITHUB_REPOSITORY GITHUB_REF GITHUB_SHA
43+ usesh : true
44+ prepare : |
45+ pkg install -y cmake ninja git
46+ run : |
47+ set -e
48+ git clone --depth 1 "https://github.com/${GITHUB_REPOSITORY}.git" src
49+ cd src
50+ # shallow clone, only the commit that triggered the run, i.e. GITHUB_SHA
51+ git fetch --depth 1 origin "${GITHUB_SHA}"
52+ git checkout "${GITHUB_SHA}"
53+ cmake -B _build -S . -G Ninja \
54+ -DCMAKE_BUILD_TYPE=Release \
55+ -DOPENEXR_FORCE_INTERNAL_IMATH=ON \
56+ -DOPENEXR_FORCE_INTERNAL_DEFLATE=ON \
57+ -DOPENEXR_FORCE_INTERNAL_OPENJPH=ON \
58+ -DBUILD_TESTING=ON
59+ cmake --build _build
60+ ctest --test-dir _build --output-on-failure
Original file line number Diff line number Diff line change @@ -29,9 +29,10 @@ call_once (once_flag* flag, void (*func) (void))
2929{
3030 InitOnceExecuteOnce (flag , once_init_fn , (PVOID ) func , NULL );
3131}
32- # elif __has_include (< threads .h > )
32+ # elif __has_include (< threads .h > ) && !defined( __FreeBSD__ )
3333/*
34- * On Linux (glibc 2.28+), use standard <threads.h>
34+ * On Linux (glibc 2.28+), use standard <threads.h>.
35+ * FreeBSD requires -lstdthreads for <threads.h>; use pthread fallback instead.
3536 */
3637# include <threads.h>
3738
You can’t perform that action at this time.
0 commit comments