mirror of
https://github.com/luxfi/netrunner.git
synced 2026-10-30 15:24:46 +00:00
25 lines
596 B
Bash
Executable File
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
|