mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #5610 from ethereum/shell-script-cleanups
build.sh bash script cleanup
This commit is contained in:
commit
055c5fe173
@ -1,28 +1,26 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
ROOTDIR="$(dirname "$0")/.."
|
||||||
|
BUILDDIR="${ROOTDIR}/build"
|
||||||
|
|
||||||
|
if [[ $# -eq 0 ]]; then
|
||||||
BUILD_TYPE=Release
|
BUILD_TYPE=Release
|
||||||
else
|
else
|
||||||
BUILD_TYPE="$1"
|
BUILD_TYPE="$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $(dirname "$0")/.. &&
|
|
||||||
|
|
||||||
if [[ "$(git tag --points-at HEAD 2>/dev/null)" == v* ]]; then
|
if [[ "$(git tag --points-at HEAD 2>/dev/null)" == v* ]]; then
|
||||||
touch prerelease.txt
|
touch "${ROOTDIR}/prerelease.txt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p build &&
|
mkdir -p "${BUILDDIR}"
|
||||||
cd build &&
|
cd "${BUILDDIR}"
|
||||||
cmake .. -DCMAKE_BUILD_TYPE="$BUILD_TYPE" &&
|
|
||||||
|
cmake .. -DCMAKE_BUILD_TYPE="$BUILD_TYPE" "${@:2}"
|
||||||
make -j2
|
make -j2
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [[ "${CI}" == "" ]]; then
|
||||||
echo "Failed to build"
|
echo "Installing ..."
|
||||||
exit 1
|
sudo make install
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z $CI ]; then
|
|
||||||
echo "Installing solc and soltest"
|
|
||||||
install solc/solc /usr/local/bin && install test/soltest /usr/local/bin
|
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user