Skip to content

Commit

Permalink
Static Build
Browse files Browse the repository at this point in the history
Co-Authored-By: gailium119 <77530553+gailium119@users.noreply.github.com>
  • Loading branch information
lzw29107 and gailium119 committed Aug 13, 2024
1 parent 4757f38 commit 7c74b4d
Showing 1 changed file with 38 additions and 13 deletions.
51 changes: 38 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:
fail-fast: false
matrix:
include:
- { icon: '🟦', sys: mingw64 }
name: 🚧${{ matrix.icon }} ${{ matrix.sys }}
- { icon: '🟦', sys: mingw64, mode: dynamic }
- { icon: '🟦', sys: mingw64, mode: static}

name: 🚧${{ matrix.icon }} ${{ matrix.sys }} Build ${{ matrix.mode }}
defaults:
run:
shell: msys2 {0}
steps:

- name: '🧰 Checkout'
uses: actions/checkout@v4
with:
fetch-depth: 0
uses: actions/checkout@main

- name: '${{ matrix.icon }} Setup MSYS2'
uses: msys2/setup-msys2@v2
Expand Down Expand Up @@ -73,19 +73,44 @@ jobs:
usbredir:p
zstd:p
libslirp:p
- name: '🚧 Build qemu (arm/aarch64)'
- name: 'Modify pkgconfig to avoid linker issues'
if: ${{ matrix.mode == 'static' }}
run: |
PKGCONFIG_FILE="$MINGW_PREFIX/lib/pkgconfig/gpg-error.pc"
sed -i 's#'$MINGW_PREFIX'/lib/libintl.dll.a#-llibintl#g' "$PKGCONFIG_FILE"
sed -i 's#'$MINGW_PREFIX'/lib/libiconv.dll.a#-llibiconv#g' "$PKGCONFIG_FILE"
- name: '🚧 Build QEMU (arm & aarch64) ${{ matrix.mode }}'
env:
arg: ${{ matrix.mode == 'dynamic' && '--enable-gtk --enable-sdl --enable-fdt=system --enable-avx2 --target-list=arm-softmmu,aarch64-softmmu' || '--disable-gtk --disable-spice --disable-usb-redir --disable-smartcard --disable-gnutls --disable-vnc-sasl --disable-libssh --enable-sdl --enable-fdt=system --enable-avx2 --target-list=arm-softmmu,aarch64-softmmu --static --extra-cflags="-DCURL_STATICLIB -DLIBSSH_STATIC -DLIBSLIRP_STATIC -DCAIRO_WIN32_STATIC_BUILD"' }}
run: |
./configure --enable-gtk --enable-sdl --enable-fdt=system --enable-avx2 --target-list=arm-softmmu,aarch64-softmmu
make -j64
./configure ${{ env.arg }}
make -j16
- name: Prepare Artifacts
shell: cmd
run: |
mkdir ${{ github.workspace }}\artifacts
move D:\a\qemu\qemu\build ${{ github.workspace }}\artifacts
md ${{ github.workspace }}\artifacts
cd ${{ github.workspace }}\artifacts
move D:\a\qemu\qemu\build\*.exe
move D:\a\qemu\qemu\build\pc-bios share
robocopy D:\a\qemu\qemu\pc-bios share /xn /xo /mov
del share\*.bz2
- name: Prepare Artifacts (dynamic only)
shell: cmd
if: ${{ matrix.mode == 'dynamic' }}
run: |
cd ${{ github.workspace }}\artifacts
copy D:\a\_temp\msys64\mingw64\bin\*.dll
md lib\gdk-pixbuf-2.0\2.10.0
fsutil file createNew lib\gdk-pixbuf-2.0\2.10.0\loaders.cache 0
move D:\a\qemu\qemu\build\po share\locale
- name: Upload artifact
uses: actions/upload-artifact@v4.3.4
uses: actions/upload-artifact@main
with:
name: artifact
name: QEMU (${{ matrix.mode }} build)
path: ${{ github.workspace }}/artifacts
compression-level: 9

0 comments on commit 7c74b4d

Please sign in to comment.