github.com/ali-iotechsys/cli@v20.10.0+incompatible/scripts/build/windows (about)

     1  #!/usr/bin/env bash
     2  #
     3  # Build a windows binary from linux
     4  #
     5  
     6  set -eu -o pipefail
     7  
     8  source ./scripts/build/.variables
     9  
    10  export CC=x86_64-w64-mingw32-gcc
    11  export CGO_ENABLED=1
    12  export GOOS=windows
    13  export GOARCH=amd64
    14  
    15  # Override TARGET
    16  TARGET="build/docker-$GOOS-$GOARCH.exe"
    17  
    18  echo "Generating windows resources"
    19  go generate ./cli/winresources
    20  
    21  echo "Building $TARGET"
    22  # TODO: -tags pkcs11
    23  go build -o "${TARGET}" --ldflags "${LDFLAGS}" "${SOURCE}"