瀏覽代碼

Make build_windows.sh faster

v2
Xerbo 1 年之前
父節點
當前提交
f394f6a356
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 34103F6D8F11CEB0
共有 3 個檔案被更改,包括 21 行新增6 行删除
  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 查看文件

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

+ 1
- 1
.github/workflows/release.yml 查看文件

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

+ 19
- 4
build_windows.sh 查看文件

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

# Build zlib from source
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 --build build -j$(nproc)
cmake --build build --target install
@@ -16,7 +16,7 @@ fi

# Build libpng from source
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 --build build -j$(nproc)
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
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
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
cmake -B $BUILD_DIR -DCMAKE_BUILD_TYPE=$1 -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH


Loading…
取消
儲存