mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	* use `set -e` to abort script execution when error codes fail (and haven't been checked)
* use [[ ]] instead of [ ] or test.
* use ROOTDIR/BUILDDIR variables for better readability
* use mktemp in order to avoid accidental name clashes.
* use `make install` instead of `install ...` as cleaner installation process
  * this however doesn't install soltest anymore, which I believe is
    right, as normal users should not need it installed in their system.
    Those who want to run the test suite, can do so manually
* allow optional passing of more additional custom args to cmake
		
	
			
		
			
				
	
	
		
			27 lines
		
	
	
		
			440 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			440 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/env bash
 | |
| set -e
 | |
| 
 | |
| 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
 |