Skip to content

Commit aa0f531

Browse files
committed
fix(build): enable sqlite_cgo_compat tags for win7
1 parent a333db8 commit aa0f531

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ldflags="\
5252
GetBuildTagsForTarget() {
5353
local target="$1"
5454
case "$target" in
55-
linux-loong64|linux-musl-loong64|linux-musl-mips|linux-musl-mips64|linux-musl-mipsle)
55+
linux-loong64|linux-musl-loong64|linux-musl-mips|linux-musl-mips64|linux-musl-mipsle|windows7-386|windows7-amd64)
5656
echo "jsoniter,sqlite_cgo_compat"
5757
;;
5858
*)
@@ -123,6 +123,7 @@ BuildWin7() {
123123
# Build for both 386 and amd64 architectures
124124
for arch in "386" "amd64"; do
125125
echo "building for windows7-${arch}"
126+
build_tags=$(GetBuildTagsForTarget "windows7-${arch}")
126127
export GOOS=windows
127128
export GOARCH=${arch}
128129
export CGO_ENABLED=1
@@ -137,7 +138,7 @@ BuildWin7() {
137138
fi
138139

139140
# Use the patched Go compiler for Win7 compatibility
140-
$(pwd)/go-win7/bin/go build -o "${1}-${arch}.exe" -ldflags="$ldflags" -tags=jsoniter .
141+
$(pwd)/go-win7/bin/go build -o "${1}-${arch}.exe" -ldflags="$ldflags" -tags="$build_tags" .
141142
done
142143
}
143144

0 commit comments

Comments
 (0)