build x86_64-win7-windows-msvc target

This commit is contained in:
ssrlive 2024-10-03 08:50:23 +08:00
parent b74aeab182
commit 93e15e0a8b

View file

@ -27,6 +27,9 @@ jobs:
- aarch64-apple-darwin - aarch64-apple-darwin
- x86_64-pc-windows-msvc - x86_64-pc-windows-msvc
- i686-pc-windows-msvc - i686-pc-windows-msvc
- aarch64-pc-windows-msvc
- x86_64-win7-windows-msvc
- i686-win7-windows-msvc
include: include:
- target: x86_64-unknown-linux-gnu - target: x86_64-unknown-linux-gnu
@ -49,6 +52,12 @@ jobs:
host_os: windows-latest host_os: windows-latest
- target: i686-pc-windows-msvc - target: i686-pc-windows-msvc
host_os: windows-latest host_os: windows-latest
- target: aarch64-pc-windows-msvc
host_os: windows-latest
- target: x86_64-win7-windows-msvc
host_os: windows-latest
- target: i686-win7-windows-msvc
host_os: windows-latest
runs-on: ${{ matrix.host_os }} runs-on: ${{ matrix.host_os }}
steps: steps:
@ -59,7 +68,9 @@ jobs:
shell: bash shell: bash
run: | run: |
mkdir mypubdir4 mkdir mypubdir4
if [[ "${{ matrix.target }}" != "x86_64-win7-windows-msvc" && "${{ matrix.target }}" != "i686-win7-windows-msvc" ]]; then
rustup target add ${{ matrix.target }} rustup target add ${{ matrix.target }}
fi
cargo install cbindgen cargo install cbindgen
if [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then if [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then
sudo .github/workflows/install-cross.sh sudo .github/workflows/install-cross.sh
@ -70,9 +81,15 @@ jobs:
run: | run: |
if [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then if [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then
cross build --all-features --release --target ${{ matrix.target }} cross build --all-features --release --target ${{ matrix.target }}
else
if [[ "${{ matrix.target }}" == "x86_64-win7-windows-msvc" || "${{ matrix.target }}" == "i686-win7-windows-msvc" ]]; then
rustup toolchain install nightly
rustup component add rust-src --toolchain nightly
cargo +nightly build --release -Z build-std --target ${{ matrix.target }}
else else
cargo build --all-features --release --target ${{ matrix.target }} cargo build --all-features --release --target ${{ matrix.target }}
fi fi
fi
cbindgen --config cbindgen.toml -l C --cpp-compat -o target/tun2proxy-ffi.h cbindgen --config cbindgen.toml -l C --cpp-compat -o target/tun2proxy-ffi.h
if [[ "${{ matrix.host_os }}" == "windows-latest" ]]; then if [[ "${{ matrix.host_os }}" == "windows-latest" ]]; then
powershell -Command "(Get-Item README.md).LastWriteTime = Get-Date" powershell -Command "(Get-Item README.md).LastWriteTime = Get-Date"