Skip to content

Commit

Permalink
feat: added GOTOOLCHAIN
Browse files Browse the repository at this point in the history
  • Loading branch information
baizon committed Jun 11, 2024
1 parent 509da20 commit bb4737b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ environment:
- QT: C:\Qt\5.15.2\msvc2019_64
GOROOT: C:\go
GOPATH: C:\gopath\
GOTOOLCHAIN: local
PLATFORM: amd64
COMPILER: msvc

Expand Down
3 changes: 2 additions & 1 deletion frontends/qt/server/Makefile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ CGO=1
BUILDMODE=c-shared
GOARCH=amd64
GOOS=linux
GOTOOLCHAIN=local

linux:
CC=clang \
CGO_CFLAGS="${GOLNXSECFLAGS} ${CFLAGS}" \
CGO_LDFLAGS="${GOLNXLDFLAGS} ${LFLAGS}" \
GOARCH=${GOARCH} CGO_ENABLED=${CGO} GOOS=${GOOS} \
GOARCH=${GOARCH} CGO_ENABLED=${CGO} GOOS=${GOOS} GOTOOLCHAIN=${GOTOOLCHAIN} \
go build -x -mod=vendor -buildmode=${BUILDMODE} -ldflags \
-extldflags="${GOLNXEXTLDFLAGS}" -o ${LIBNAME}.so

Expand Down
3 changes: 2 additions & 1 deletion frontends/qt/server/Makefile.macosx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ CGO=1
BUILDMODE=c-shared
GOARCH=amd64
GOOS=darwin
GOTOOLCHAIN=local

darwin:
CGO_CFLAGS="-g ${GODARWINSECFLAGS} ${CFLAGS}" \
CGO_LDFLAGS="${GODARWINLDFLAGS} ${LFLAGS}" \
MACOSX_DEPLOYMENT_TARGET=${MACOS_MIN_VERSION} \
GOARCH=${GOARCH} CGO_ENABLED=${CGO} GOOS=${GOOS} \
GOARCH=${GOARCH} CGO_ENABLED=${CGO} GOOS=${GOOS} GOTOOLCHAIN=${GOTOOLCHAIN} \
go build -ldflags='-s' -x -mod=vendor \
-buildmode="c-shared" -o ${LIBNAME}.so

Expand Down
5 changes: 3 additions & 2 deletions frontends/qt/server/Makefile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ CGO=1
BUILDMODE=c-shared
GOARCH=amd64
GOOS=windows
GOTOOLCHAIN=local

windows:
CGO_CFLAGS="${GOWINSECFLAGS} ${CFLAGS}" \
CGO_LDFLAGS="${GOWINLDFLAGS} ${LFLAGS}" \
GOARCH=${GOARCH} CGO_ENABLED=${CGO} GOOS=${GOOS} \
GOARCH=${GOARCH} CGO_ENABLED=${CGO} GOOS=${GOOS} GOTOOLCHAIN=${GOTOOLCHAIN} \
go build -x -mod=vendor \
-buildmode="${BUILDMODE}" -o ${LIBNAME}.dll

Expand All @@ -17,7 +18,7 @@ windows-cross:
CC_FOR_TARGET=/usr/bin/x86_64-w64-mingw32-gcc \
CGO_CFLAGS="-g ${GOWINSECFLAGS} ${CFLAGS}" \
CGO_LDFLAGS="${GOWINLDFLAGS} ${LFLAGS}" \
GOARCH=${GOARCH} CGO_ENABLED=${CGO} GOOS=${GOOS} \
GOARCH=${GOARCH} CGO_ENABLED=${CGO} GOOS=${GOOS} GOTOOLCHAIN=${GOTOOLCHAIN} \
go build -x -mod=vendor \
-buildmode="${BUILDMODE}" -o ${LIBNAME}.dll

Expand Down
1 change: 1 addition & 0 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set -x

# Set go-langs data race detector options
export GORACE="halt_on_error=1"
export GOTOOLCHAIN="local"

# This script has to be called from the project root directory.
go build -mod=vendor ./...
Expand Down

0 comments on commit bb4737b

Please sign in to comment.