Use correct dylib extension for local os
This commit is contained in:
parent
5c4a8b0ca0
commit
72fa53bac3
1 changed files with 11 additions and 1 deletions
12
build.sh
12
build.sh
|
@ -2,7 +2,17 @@ cargo build || exit 1
|
|||
|
||||
cd examples/
|
||||
|
||||
RUSTC="rustc -Zcodegen-backend=$(pwd)/../target/debug/librustc_codegen_cranelift.so -L crate=. --crate-type lib"
|
||||
unamestr=`uname`
|
||||
if [[ "$unamestr" == 'Linux' ]]; then
|
||||
dylib_ext='so'
|
||||
elif [[ "$unamestr" == 'Darwin' ]]; then
|
||||
dylib_ext='dylib'
|
||||
else
|
||||
echo "Unsupported os"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RUSTC="rustc -Zcodegen-backend=$(pwd)/../target/debug/librustc_codegen_cranelift.$dylib_ext -L crate=. --crate-type lib"
|
||||
|
||||
$RUSTC mini_core.rs --crate-name mini_core &&
|
||||
$RUSTC example.rs &&
|
||||
|
|
Loading…
Reference in a new issue