Files
2025-07-20 08:38:06 +00:00

25 lines
596 B
Bash
Executable File

#!/bin/bash
# Run with ./scripts/build.sh <optional_build_location>
if ! [[ "$0" =~ scripts/build.sh ]]; then
echo "must be run from repository root"
exit 1
fi
VERSION=`cat VERSION`
if [ $# -eq 0 ] ; then
OUTPUT="bin"
else
OUTPUT=$1
fi
# Set the CGO flags to use the portable version of BLST
#
# We use "export" here instead of just setting a bash variable because we need
# to pass this flag to all child processes spawned by the shell.
export CGO_CFLAGS="-O -D__BLST_PORTABLE__"
go build -v -ldflags="-X 'github.com/luxfi/netrunner/cmd.Version=$VERSION'" -o $OUTPUT/netrunner