Skip to content

Commit

Permalink
(ref) osx: serail same as keepawake
Browse files Browse the repository at this point in the history
  • Loading branch information
MementoRC committed Dec 12, 2024
1 parent e979956 commit 32cad4b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
12 changes: 7 additions & 5 deletions recipes/keepawake-rs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=$CC
export CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER=$CC

BINDGEN_EXTRA_CLANG_ARGS="-v ${CPPFLAGS} ${CFLAGS}"
if [[ "${target_platform}" == osx-arm64 ]]; then
BINDGEN_EXTRA_CLANG_ARGS="${BINDGEN_EXTRA_CLANG_ARGS} --target=aarch64-apple-darwin"
else
BINDGEN_EXTRA_CLANG_ARGS="${BINDGEN_EXTRA_CLANG_ARGS} --target=x86_64-apple-darwin13.4.0"
if [[ "${target_platform}" == osx-* ]]; then
if [[ "${target_platform}" == osx-arm64 ]]; then
BINDGEN_EXTRA_CLANG_ARGS="${BINDGEN_EXTRA_CLANG_ARGS} --target=aarch64-apple-darwin"
else
BINDGEN_EXTRA_CLANG_ARGS="${BINDGEN_EXTRA_CLANG_ARGS} --target=x86_64-apple-darwin13.4.0"
fi
export LIBCLANG_PATH=${BUILD_PREFIX}/lib
fi
export LIBCLANG_PATH=${BUILD_PREFIX}/lib

cargo build --release --all-targets
# Skip doc-test which fails to find cc as a linker (odd, since it can build just fine)
Expand Down
13 changes: 13 additions & 0 deletions recipes/serial-monitor-rust/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

set -euxo pipefail

export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=$CC
export CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER=$CC

BINDGEN_EXTRA_CLANG_ARGS="-v ${CPPFLAGS} ${CFLAGS}"
if [[ "${target_platform}" == osx-* ]]; then
if [[ "${target_platform}" == osx-arm64 ]]; then
BINDGEN_EXTRA_CLANG_ARGS="${BINDGEN_EXTRA_CLANG_ARGS} --target=aarch64-apple-darwin"
else
BINDGEN_EXTRA_CLANG_ARGS="${BINDGEN_EXTRA_CLANG_ARGS} --target=x86_64-apple-darwin13.4.0"
fi
export LIBCLANG_PATH=${BUILD_PREFIX}/lib
fi

cargo build --release --all-targets
cargo test --release --all-targets
CARGO_TARGET_DIR=target cargo install --path . --root "${PREFIX}"
Expand Down

0 comments on commit 32cad4b

Please sign in to comment.