Browse Source

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`.
tags/v1.22.0-rc0
Sergey Zolotarev 7 months ago
parent
commit
6acce16ee3
No account linked to committer's email address
1 changed files with 8 additions and 4 deletions
  1. 8
    4
      Makefile

+ 8
- 4
Makefile View File

@@ -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

Loading…
Cancel
Save