fix: build script

fix/data-structure
paring 2022-11-13 15:48:46 +09:00
parent 781f09d2f5
commit fe9e617d99
1 changed files with 14 additions and 8 deletions

View File

@ -6,18 +6,24 @@ platform=$(uname)
echo Current platform: $platform
mkdir -p out/x86_64
mkdir -p out/aarch64
mkdir -p out/i686
if [[ $platform == 'Linux' ]]; then
mkdir -p out/x86_64
mkdir -p out/i686
cargo build --release --target x86_64-unknown-linux-gnu
cp target/x86_64-unknown-linux-gnu/release/libskyhook.so out/x86_64
elif [[ $platform == 'Darwin' ]]; then
cargo build --release --target x86_64-apple-darwin
cargo build --release --target aarch64-apple-darwin
TARGET_X86=x86_64-apple-darwin
TARGET_ARM=aarch64-apple-darwin
cp target/x86_64-apple-darwin/release/libskyhook.dylib out/x86_64
cp target/aarch64-apple-darwin/release/libskyhook.dylib out/aarch64
cargo build --release --target $TARGET_X86
cargo build --release --target $TARGET_ARM
lipo -create -output out/skyhook.bundle \
target/${TARGET_X86}/release/libskyhook.dylib \
target/${TARGET_ARM}/release/libskyhook.dylib
# cp target/x86_64-apple-darwin/release/libskyhook.dylib out/x86_64
# cp target/aarch64-apple-darwin/release/libskyhook.dylib out/aarch64
fi