This repository has been archived on 2023-05-28. You can view files and clone it, but cannot push or open issues/pull-requests.
SkyHook-Native/build.sh

30 lines
772 B
Bash
Raw Normal View History

2022-11-03 19:22:12 +09:00
#!/bin/bash
set -x
2022-11-03 23:50:50 +09:00
platform=$(uname)
echo Current platform: $platform
if [[ $platform == 'Linux' ]]; then
2022-11-13 15:48:46 +09:00
mkdir -p out/x86_64
mkdir -p out/i686
2022-11-03 23:50:50 +09:00
cargo build --release --target x86_64-unknown-linux-gnu
2022-11-03 19:22:12 +09:00
2022-11-03 23:50:50 +09:00
cp target/x86_64-unknown-linux-gnu/release/libskyhook.so out/x86_64
elif [[ $platform == 'Darwin' ]]; then
2022-11-13 15:48:46 +09:00
TARGET_X86=x86_64-apple-darwin
TARGET_ARM=aarch64-apple-darwin
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
2022-11-03 19:22:12 +09:00
2022-11-13 15:48:46 +09:00
# cp target/x86_64-apple-darwin/release/libskyhook.dylib out/x86_64
# cp target/aarch64-apple-darwin/release/libskyhook.dylib out/aarch64
2022-11-03 23:50:50 +09:00
fi