diff --git a/Makefile b/Makefile index 4cc6a56..9a3fb03 100644 --- a/Makefile +++ b/Makefile @@ -35,13 +35,15 @@ ifeq ($(TARGET_ARCH),arm64) APPIMAGE_ARCH := aarch64 DEB_ARCH := arm64 RPM_ARCH := aarch64 -WINDOWS_WINDRES_FORMAT := pe-aarch64 +WINDOWS_WINDRES_FORMAT_BFD := pe-aarch64 +WINDOWS_WINDRES_FORMAT_LLVM := aarch64-w64-mingw32 WINDOWS_RESOURCE := rsrc_windows_arm64.syso else APPIMAGE_ARCH := x86_64 DEB_ARCH := amd64 RPM_ARCH := x86_64 -WINDOWS_WINDRES_FORMAT := pe-x86-64 +WINDOWS_WINDRES_FORMAT_BFD := pe-x86-64 +WINDOWS_WINDRES_FORMAT_LLVM := x86_64-w64-mingw32 WINDOWS_RESOURCE := rsrc_windows_amd64.syso endif @@ -177,13 +179,16 @@ _desktop-prepare-embedfs: _desktop-prepare-windows-resource: _check-windows-target-arch @printf 'Preparing Windows $(TARGET_ARCH) executable icon...\n' - @if [ "$(TARGET_ARCH)" = "arm64" ] && [ "$(WINDRES)" = "windres" ] && command -v llvm-windres >/dev/null 2>&1; then \ + @WINDRES_CMD="$(WINDRES)"; \ + WINDRES_FMT="$(WINDOWS_WINDRES_FORMAT_BFD)"; \ + if command -v llvm-windres >/dev/null 2>&1; then \ WINDRES_CMD=llvm-windres; \ - else \ - WINDRES_CMD="$(WINDRES)"; \ + WINDRES_FMT="$(WINDOWS_WINDRES_FORMAT_LLVM)"; \ + elif "$$WINDRES_CMD" --version 2>&1 | grep -qi LLVM; then \ + WINDRES_FMT="$(WINDOWS_WINDRES_FORMAT_LLVM)"; \ fi; \ command -v "$$WINDRES_CMD" >/dev/null 2>&1 || { printf 'Missing windres tool: %s\n' "$$WINDRES_CMD"; exit 1; }; \ - cd backend/cmd/desktop && "$$WINDRES_CMD" -O coff -F $(WINDOWS_WINDRES_FORMAT) -i icon_windows.rc -o $(WINDOWS_RESOURCE) + cd backend/cmd/desktop && "$$WINDRES_CMD" -O coff -F "$$WINDRES_FMT" -i icon_windows.rc -o $(WINDOWS_RESOURCE) # ============================================ # 发布资产