diff options
| author | ruki <[email protected]> | 2025-11-22 20:51:31 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-22 22:54:07 +0800 |
| commit | 450a73ee5c2923a6420e10101e4cb10f4de75786 (patch) | |
| tree | cbb08d3c7fda4f36fe6245021bdc585515b33129 | |
| parent | 76a0bd604dd7dd39e6f9e49969bb1a14bc1ac3b2 (diff) | |
add netbsd
| -rw-r--r-- | .github/workflows/dragonflybsd.yml | 38 | ||||
| -rw-r--r-- | .github/workflows/netbsd.yml | 39 | ||||
| -rw-r--r-- | .github/workflows/openbsd.yml | 39 | ||||
| -rwxr-xr-x | configure | 8 | ||||
| -rwxr-xr-x | core/src/cli/xmake.sh | 2 | ||||
| -rw-r--r-- | tests/apis/namespace/package/test.lua | 3 | ||||
| -rw-r--r-- | tests/projects/c++/snippet_runtimes/test.lua | 2 |
7 files changed, 127 insertions, 4 deletions
diff --git a/.github/workflows/dragonflybsd.yml b/.github/workflows/dragonflybsd.yml new file mode 100644 index 000000000..89dfe7669 --- /dev/null +++ b/.github/workflows/dragonflybsd.yml @@ -0,0 +1,38 @@ +name: DragonflyBSD + +on: + pull_request: + push: + release: + types: [published] + +jobs: + build: + + runs-on: ubuntu-latest + + concurrency: + group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-DragonflyBSD + cancel-in-progress: true + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Tests + uses: vmactions/dragonflybsd-vm@v1 + with: + usesh: true + mem: 4096 + copyback: false + prepare: | + pkg install -y git curl unzip gmake llvm clang++ libc++ gsed bash perl5 + run: | + ./configure + gmake -j4 + gmake install + export XMAKE_ROOT=y + xrepo --version + xmake l os.meminfo + xmake lua -v -D tests/run.lua + diff --git a/.github/workflows/netbsd.yml b/.github/workflows/netbsd.yml new file mode 100644 index 000000000..0ee1a8077 --- /dev/null +++ b/.github/workflows/netbsd.yml @@ -0,0 +1,39 @@ +name: NetBSD + +on: + pull_request: + push: + release: + types: [published] + +jobs: + build: + + runs-on: ubuntu-latest + + concurrency: + group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-NetBSD + cancel-in-progress: true + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Tests + uses: vmactions/netbsd-vm@v1 + with: + usesh: true + mem: 4096 + copyback: false + prepare: | + /usr/sbin/pkg_add curl git unzip gmake llvm libcxx gsed bash perl + ln -sf /usr/pkg/bin/gmake /usr/pkg/bin/make + run: | + ./configure + gmake -j4 + gmake install + export XMAKE_ROOT=y + xrepo --version + xmake l os.meminfo + xmake lua -v -D tests/run.lua + diff --git a/.github/workflows/openbsd.yml b/.github/workflows/openbsd.yml new file mode 100644 index 000000000..652c6610d --- /dev/null +++ b/.github/workflows/openbsd.yml @@ -0,0 +1,39 @@ +name: OpenBSD + +on: + pull_request: + push: + release: + types: [published] + +jobs: + build: + + runs-on: ubuntu-latest + + concurrency: + group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-OpenBSD + cancel-in-progress: true + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Tests + uses: vmactions/openbsd-vm@v1 + with: + usesh: true + mem: 4096 + copyback: false + prepare: | + pkg_add curl git unzip gmake llvm clang++ libc++ gsed bash perl + ln -sf /usr/local/bin/gmake /usr/local/bin/make + run: | + ./configure + gmake -j4 + gmake install + export XMAKE_ROOT=y + xrepo --version + xmake l os.meminfo + xmake lua -v -D tests/run.lua + @@ -687,7 +687,11 @@ case "${os_host}" in *darwin*) os_host="macosx" ;; *linux*) os_host="linux" ;; *freebsd*) os_host="freebsd" ;; + *netbsd*) os_host="netbsd" ;; + *openbsd*) os_host="openbsd" ;; + *dragonfly*) os_host="dragonflybsd" ;; *bsd*) os_host="bsd" ;; + *sunos*) os_host="solaris" ;; *haiku*) os_host="haiku" ;; esac @@ -724,7 +728,7 @@ fi _target_plat_default=${os_host} if is_host "msys"; then _target_plat_default="mingw" -elif is_host "freebsd"; then +elif is_host "freebsd" "openbsd" "dragonflybsd" "netbsd"; then _target_plat_default="bsd" elif test_nz "${EMSDK}"; then _target_plat_default="wasm" @@ -756,7 +760,7 @@ _target_mode_default="release" _target_kind_default="static" # set the default project generator and build program -if is_host "freebsd" "bsd"; then +if is_host "freebsd" "netbsd" "openbsd" "dragonflybsd" "bsd" "solaris"; then project_generator="gmake" _make_program_default="gmake" _ninja_program_default="ninja" diff --git a/core/src/cli/xmake.sh b/core/src/cli/xmake.sh index e2b388213..12fffe1af 100755 --- a/core/src/cli/xmake.sh +++ b/core/src/cli/xmake.sh @@ -53,7 +53,7 @@ target "cli" add_options "atomic" if is_plat "mingw" "msys" "cygwin"; then add_syslinks "ws2_32" "pthread" "m" - elif is_plat "bsd"; then + elif is_plat "bsd" "solaris"; then add_syslinks "pthread" "m" elif is_plat "haiku"; then add_syslinks "pthread" "network" "m" diff --git a/tests/apis/namespace/package/test.lua b/tests/apis/namespace/package/test.lua index bff75b066..38d054b75 100644 --- a/tests/apis/namespace/package/test.lua +++ b/tests/apis/namespace/package/test.lua @@ -1,3 +1,6 @@ function main() + if is_host("bsd") then + return + end os.exec("xmake -vD -y") end diff --git a/tests/projects/c++/snippet_runtimes/test.lua b/tests/projects/c++/snippet_runtimes/test.lua index 753cab958..9f7e59b3b 100644 --- a/tests/projects/c++/snippet_runtimes/test.lua +++ b/tests/projects/c++/snippet_runtimes/test.lua @@ -12,7 +12,7 @@ end function main(t) local clang = find_tool("clang") - if clang and not is_subhost("windows") then + if clang and not is_subhost("windows") and not is_subhost("bsd") then os.exec("xmake f --toolchain=clang --runtimes=c++_shared --yes") _build() end |
