Browse Source

Make build_windows.sh faster

v2
Xerbo 1 year ago
parent
commit
f394f6a356
No known key found for this signature in database GPG Key ID: 34103F6D8F11CEB0
3 changed files with 21 additions and 6 deletions
  1. +1
    -1
      .github/workflows/build.yml
  2. +1
    -1
      .github/workflows/release.yml
  3. +19
    -4
      build_windows.sh

+ 1
- 1
.github/workflows/build.yml View File

@@ -60,4 +60,4 @@ jobs:
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: ZIP package name: ZIP package
path: build/aptdec_*.zip
path: winbuild/aptdec_*.zip

+ 1
- 1
.github/workflows/release.yml View File

@@ -86,4 +86,4 @@ jobs:
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: ZIP package name: ZIP package
path: build/aptdec_*.zip
path: winbuild/aptdec_*.zip

+ 19
- 4
build_windows.sh View File

@@ -7,7 +7,7 @@ BUILD_DIR="winbuild"


# Build zlib from source # Build zlib from source
if [ ! -d "zlib" ]; then if [ ! -d "zlib" ]; then
git clone -b v1.2.13 https://github.com/madler/zlib && cd zlib
git clone --depth 1 -b v1.2.13 https://github.com/madler/zlib && cd zlib
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH
cmake --build build -j$(nproc) cmake --build build -j$(nproc)
cmake --build build --target install cmake --build build --target install
@@ -16,7 +16,7 @@ fi


# Build libpng from source # Build libpng from source
if [ ! -d "libpng" ]; then if [ ! -d "libpng" ]; then
git clone -b v1.6.39 https://github.com/glennrp/libpng && cd libpng
git clone --depth 1 -b v1.6.39 https://github.com/glennrp/libpng && cd libpng
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH
cmake --build build -j$(nproc) cmake --build build -j$(nproc)
cmake --build build --target install cmake --build build --target install
@@ -32,9 +32,24 @@ if [ ! -d libsndfile-1.2.0-win64 ]; then
cp "libsndfile-1.2.0-win64/lib/sndfile.lib" $TEMP_PATH/lib cp "libsndfile-1.2.0-win64/lib/sndfile.lib" $TEMP_PATH/lib
fi fi


find_dll() {
filename=$(x86_64-w64-mingw32-gcc -print-file-name=$1)
if [ -f $filename ]; then
echo $filename
else
filename=$(x86_64-w64-mingw32-gcc -print-sysroot)/mingw/bin/$1
if [ -f $filename ]; then
echo $filename
else
echo "Could not find $1" >&2
return 1
fi
fi
}

# Copy required GCC libs # Copy required GCC libs
cp $(find /usr | grep libgcc_s_seh-1.dll | head -n 1) $TEMP_PATH/bin
cp $(find /usr | grep libwinpthread-1.dll | head -n 1) $TEMP_PATH/bin
cp $(find_dll file-name=libgcc_s_seh-1.dll) $TEMP_PATH/bin
cp $(find_dll file-name=libwinpthread-1.dll) $TEMP_PATH/bin


# Build aptdec # Build aptdec
cmake -B $BUILD_DIR -DCMAKE_BUILD_TYPE=$1 -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH cmake -B $BUILD_DIR -DCMAKE_BUILD_TYPE=$1 -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH


Loading…
Cancel
Save