solidity/scripts/build.sh
2022-03-25 12:53:55 -05:00

31 lines
534 B
Bash
Executable File

#!/usr/bin/env bash
set -e
apt-get update
apt-get install -y curl zip unzip tar
git submodule update --init --recursive
ROOTDIR="$(dirname "$0")/.."
BUILDDIR="${ROOTDIR}/build"
if [[ $# -eq 0 ]]; then
BUILD_TYPE=Release
else
BUILD_TYPE="$1"
fi
if [[ "$(git tag --points-at HEAD 2>/dev/null)" == v* ]]; then
touch "${ROOTDIR}/prerelease.txt"
fi
mkdir -p "${BUILDDIR}"
cd "${BUILDDIR}"
cmake .. -DCMAKE_BUILD_TYPE="$BUILD_TYPE" "${@:2}"
make -j2
if [[ "${CI}" == "" ]]; then
echo "Installing ..."
sudo make install
fi