diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c4acba6..b568ae3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/build_windows.bat b/build_windows.bat index 3f995cf..133d153 100644 --- a/build_windows.bat +++ b/build_windows.bat @@ -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