mirror of https://github.com/docker/cli.git
darwin/build: Disallow CGO_ENABLED=1 when cross-compiling
Cross compiling CGO to Darwin requires an Apple SDK. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
870ad7f4b9
commit
094af6ea07
|
@ -44,6 +44,16 @@ if [ "${GOOS}" = "windows" ]; then
|
|||
fi
|
||||
export TARGET
|
||||
|
||||
# No CGO when cross building to darwin
|
||||
if [ "$(go env GOOS)" = "darwin" ] && [ "$(uname)" != "Darwin" ]; then
|
||||
if [ -z "$CGO_ENABLED" ]; then
|
||||
CGO_ENABLED=0
|
||||
elif [ "$CGO_ENABLED" = "1" ]; then
|
||||
echo "CGO_ENABLED=1 not supported when cross-compiling for Darwin"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$CGO_ENABLED" ]; then
|
||||
case "$(go env GOOS)" in
|
||||
linux)
|
||||
|
|
Loading…
Reference in New Issue