mirror of
https://github.com/docker/cli.git
synced 2025-08-29 00:47:54 +03:00
In case go build will see a need to call C++ (rather than C) compiler, CXX env var need to be properly set (to osxcross wrapper). Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
23 lines
461 B
Bash
Executable File
23 lines
461 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Build an osx binary from linux
|
|
#
|
|
|
|
set -eu -o pipefail
|
|
|
|
source ./scripts/build/.variables
|
|
|
|
export CGO_ENABLED=1
|
|
export GOOS=darwin
|
|
export GOARCH=amd64
|
|
export CC=o64-clang
|
|
export CXX=o64-clang++
|
|
export LDFLAGS="$LDFLAGS -linkmode external -s"
|
|
export LDFLAGS_STATIC_DOCKER='-extld='${CC}
|
|
|
|
# Override TARGET
|
|
TARGET="build/docker-$GOOS-$GOARCH"
|
|
|
|
echo "Building $TARGET"
|
|
go build -o "${TARGET}" -tags pkcs11 --ldflags "${LDFLAGS}" "${SOURCE}"
|