summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-11-22 20:51:31 +0800
committerruki <[email protected]>2025-11-22 22:54:07 +0800
commit450a73ee5c2923a6420e10101e4cb10f4de75786 (patch)
treecbb08d3c7fda4f36fe6245021bdc585515b33129
parent76a0bd604dd7dd39e6f9e49969bb1a14bc1ac3b2 (diff)
add netbsd
-rw-r--r--.github/workflows/dragonflybsd.yml38
-rw-r--r--.github/workflows/netbsd.yml39
-rw-r--r--.github/workflows/openbsd.yml39
-rwxr-xr-xconfigure8
-rwxr-xr-xcore/src/cli/xmake.sh2
-rw-r--r--tests/apis/namespace/package/test.lua3
-rw-r--r--tests/projects/c++/snippet_runtimes/test.lua2
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
+
diff --git a/configure b/configure
index 3c82790b6..e14536e6e 100755
--- a/configure
+++ b/configure
@@ -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