From 7b7bf7aea5a6a60a7c4e6234391052fcd633a1da Mon Sep 17 00:00:00 2001 From: VectoDE Date: Tue, 21 Oct 2025 21:08:46 +0200 Subject: [PATCH 1/2] Ensure desktop console build tag --- scripts/build.bat | 2 +- scripts/build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build.bat b/scripts/build.bat index 817ac43..df0a784 100644 --- a/scripts/build.bat +++ b/scripts/build.bat @@ -62,7 +62,7 @@ if /I "!TARGET_OS!"=="windows" ( set "GOOS=!TARGET_OS!" set "GOARCH=!TARGET_ARCH!" -go build -o "!TARGET_OUTPUT!" "!MAIN_PKG!" +go build -tags desktop -o "!TARGET_OUTPUT!" "!MAIN_PKG!" if errorlevel 1 ( echo Failed to build !TARGET_OS!/!TARGET_ARCH!. exit /b 1 diff --git a/scripts/build.sh b/scripts/build.sh index 5d749fa..b39c374 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -32,7 +32,7 @@ build_target() { print_step "Building ${os}/${arch}..." GOOS="${os}" GOARCH="${arch}" CGO_ENABLED=0 \ - go build -o "${output}" "${MAIN_PKG}" + go build -tags desktop -o "${output}" "${MAIN_PKG}" } build_target linux amd64 "${BUILD_DIR}/${APP_NAME}-linux-amd64" From f061a582f55548758b450d953f8e557f4adcd4dc Mon Sep 17 00:00:00 2001 From: VectoDE Date: Tue, 21 Oct 2025 21:25:32 +0200 Subject: [PATCH 2/2] Allow optional GO build tags --- scripts/build.bat | 6 +++++- scripts/build.sh | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/build.bat b/scripts/build.bat index df0a784..88ca0c4 100644 --- a/scripts/build.bat +++ b/scripts/build.bat @@ -62,7 +62,11 @@ if /I "!TARGET_OS!"=="windows" ( set "GOOS=!TARGET_OS!" set "GOARCH=!TARGET_ARCH!" -go build -tags desktop -o "!TARGET_OUTPUT!" "!MAIN_PKG!" +set "BUILD_TAG_ARGS=" +if defined GO_BUILD_TAGS ( + set "BUILD_TAG_ARGS=-tags ""!GO_BUILD_TAGS!""" +) +go build !BUILD_TAG_ARGS! -o "!TARGET_OUTPUT!" "!MAIN_PKG!" if errorlevel 1 ( echo Failed to build !TARGET_OS!/!TARGET_ARCH!. exit /b 1 diff --git a/scripts/build.sh b/scripts/build.sh index b39c374..d8822c2 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -29,10 +29,15 @@ build_target() { local os="$1" local arch="$2" local output="$3" + local tags=( ) + + if [[ -n "${GO_BUILD_TAGS:-}" ]]; then + tags=(-tags "${GO_BUILD_TAGS}") + fi print_step "Building ${os}/${arch}..." GOOS="${os}" GOARCH="${arch}" CGO_ENABLED=0 \ - go build -tags desktop -o "${output}" "${MAIN_PKG}" + go build "${tags[@]}" -o "${output}" "${MAIN_PKG}" } build_target linux amd64 "${BUILD_DIR}/${APP_NAME}-linux-amd64"