Browse Source

MSVC build in GitHub actions

v2
Xerbo 1 year ago
parent
commit
711d0e0163
No known key found for this signature in database GPG Key ID: 34103F6D8F11CEB0
2 changed files with 31 additions and 11 deletions
  1. +18
    -0
      .github/workflows/build.yml
  2. +13
    -11
      build_windows.bat

+ 18
- 0
.github/workflows/build.yml View File

@@ -61,3 +61,21 @@ jobs:
with:
name: ZIP package
path: winbuild/aptdec_*.zip
build_windows_msvc:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0

- name: Run build script
run: vcvarsx86_amd64 & ./build_windows.bat

- name: Upload ZIP package
uses: actions/upload-artifact@v3
with:
name: ZIP package (MSVC)
path: winbuild/aptdec_*.zip

+ 13
- 11
build_windows.bat View File

@@ -1,36 +1,38 @@
REM Build using MSVC on Windows
REM Requires: git, cmake and ninja
REM You need to run vcvars before running this
REM Build zlib
IF NOT EXIST zlib (
git clone -b v1.2.13 https://github.com/madler/zlib
git clone --depth 1 -b v1.2.13 https://github.com/madler/zlib
cd zlib
cmake -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DMSVC_TOOLSET_VERSION=190 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../winpath
cmake --build build -j4
cmake -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../winpath
cmake --build build -j%NUMBER_OF_PROCESSORS%
cmake --build build --target install
cd ..
)
REM Build libpng
IF NOT EXIST libpng (
git clone -b v1.6.39 https://github.com/glennrp/libpng
git clone --depth 1 -b v1.6.39 https://github.com/glennrp/libpng
cd libpng
cmake -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DMSVC_TOOLSET_VERSION=190 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../winpath -DPNG_STATIC=OFF -DPNG_EXECUTABLES=OFF -DPNG_TESTS=OFF
cmake --build build -j4
cmake -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../winpath -DPNG_STATIC=OFF -DPNG_EXECUTABLES=OFF -DPNG_TESTS=OFF
cmake --build build -j%NUMBER_OF_PROCESSORS%
cmake --build build --target install
cd ..
)
REM Build libsndfile, only with WAV support
IF NOT EXIST libsndfile (
git clone -b 1.2.0 https://github.com/libsndfile/libsndfile
git clone --depth 1 -b 1.2.0 https://github.com/libsndfile/libsndfile
cd libsndfile
cmake -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DMSVC_TOOLSET_VERSION=190 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../winpath -BUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF -DBUILD_PROGRAMS=OFF
cmake --build build -j4
cmake -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../winpath -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF -DBUILD_PROGRAMS=OFF
cmake --build build -j%NUMBER_OF_PROCESSORS%
cmake --build build --target install
cd ..
)
REM Build aptdec
cmake -B winbuild -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DMSVC_TOOLSET_VERSION=190 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../winpath
cmake --build winbuil -j4
cmake -B winbuild -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../winpath
cmake --build winbuild -j%NUMBER_OF_PROCESSORS%
cmake --build winbuild --target package

Loading…
Cancel
Save