1
1
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-18 00:13:57 +01:00

Remove .exe suffix when cross-compiling on Windows (#27448)

When compiling GItea for Linux on Windows, you get a `gitea.exe` file as
output, but because it's a Linux executable, the `.exe` extension is
unnecessary.

This PR adds a check for `GOOS` environment variable in addition to
`OS`.
This commit is contained in:
Sergey Zolotarev 2023-10-06 20:39:21 +00:00 committed by GitHub
parent e820d9966d
commit 6acce16ee3
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23

@ -49,10 +49,14 @@ ifeq ($(HAS_GO), yes)
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
endif
ifeq ($(OS), Windows_NT)
GOFLAGS := -v -buildmode=exe
EXECUTABLE ?= gitea.exe
else ifeq ($(OS), Windows)
ifeq ($(GOOS),windows)
IS_WINDOWS := yes
else ifeq ($(patsubst Windows%,Windows,$(OS)),Windows)
ifeq ($(GOOS),)
IS_WINDOWS := yes
endif
endif
ifeq ($(IS_WINDOWS),yes)
GOFLAGS := -v -buildmode=exe
EXECUTABLE ?= gitea.exe
else