solidity/scripts/build.sh

27 lines
440 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
set -e
ROOTDIR="$(dirname "$0")/.."
BUILDDIR="${ROOTDIR}/build"
if [[ $# -eq 0 ]]; then
BUILD_TYPE=Release
else
BUILD_TYPE="$1"
fi
2017-12-06 14:14:54 +00:00
if [[ "$(git tag --points-at HEAD 2>/dev/null)" == v* ]]; then
touch "${ROOTDIR}/prerelease.txt"
2017-12-06 14:14:54 +00:00
fi
mkdir -p "${BUILDDIR}"
cd "${BUILDDIR}"
cmake .. -DCMAKE_BUILD_TYPE="$BUILD_TYPE" "${@:2}"
make -j2
if [[ "${CI}" == "" ]]; then
echo "Installing ..."
sudo make install
fi