Skip to content

Commit

Permalink
try cross for cross compile
Browse files Browse the repository at this point in the history
  • Loading branch information
samansmink committed Mar 26, 2024
1 parent a71ba28 commit 59f5ee9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/_extension_distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ jobs:
with:
targets: aarch64-unknown-linux-gnu

- name: Setup Rust for cross compile
if: ${{ matrix.duckdb_arch == 'linux_arm64'}}
run: |
cargo install cross --git https://github.com/cross-rs/cross
- name: Setup Rust for manylinux (dtolnay/rust-toolchain doesn't work due to curl being old here)
if: ${{ matrix.duckdb_arch == 'linux_amd64_gcc4' }}
run: |
Expand Down
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,22 @@ elseif("${OS_NAME}" STREQUAL "osx")
endif()
endif()

if("${USE_RUST_CROSS}")
set(RUST_COMMAND "cargo")
else()
set(RUST_COMMAND "cross")
endif()

# OVerride TODO remove
set(RUST_COMMAND "cross")

# Add rust_example as a CMake target
ExternalProject_Add(
${KERNEL_NAME}
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND cargo build --package deltakernel-ffi --all-features --target=${RUST_PLATFORM_TARGET}
COMMAND cargo build --package deltakernel-ffi --all-features --release --target=${RUST_PLATFORM_TARGET}
BUILD_COMMAND ${RUST_COMMAND} build --package deltakernel-ffi --all-features --target=${RUST_PLATFORM_TARGET}
COMMAND ${RUST_COMMAND} build --package deltakernel-ffi --all-features --release --target=${RUST_PLATFORM_TARGET}
BINARY_DIR "${CMAKE_SOURCE_DIR}/../delta-kernel-rs"
BUILD_BYPRODUCTS "${CMAKE_SOURCE_DIR}/../delta-kernel-rs/target/${RUST_PLATFORM_TARGET}/debug/libdeltakernel_ffi.a"
BUILD_BYPRODUCTS "${CMAKE_SOURCE_DIR}/../delta-kernel-rs/target/${RUST_PLATFORM_TARGET}/release/libdeltakernel_ffi.a"
Expand Down

0 comments on commit 59f5ee9

Please sign in to comment.