Skip to content

Commit

Permalink
Fix cargo binary at configure time (bytecodealliance#6977)
Browse files Browse the repository at this point in the history
This allows for running the generated make files directly if your
confirgure step wants to use a vendored cargo program.

Signed-off-by: Tyler Rockwood <[email protected]>
  • Loading branch information
rockwotj authored Sep 7, 2023
1 parent 3f07d27 commit 181d005
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/c-api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ if(ANDROID)
-L ${CMAKE_BINARY_DIR} -C linker=${ANDROID_TOOLCHAIN_ROOT}/bin/ld")
endif()
include(ExternalProject)
find_program(WASMTIME_CARGO_BINARY cargo)
ExternalProject_Add(
wasmtime-crate
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
INSTALL_COMMAND "${WASMTIME_INSTALL_COMMAND}"
BUILD_COMMAND ${WASMTIME_PREBUILD_COMMAND} cargo build ${WASMTIME_BUILD_TYPE_FLAG} ${WASMTIME_BUILD_TARGET}
BUILD_COMMAND ${WASMTIME_PREBUILD_COMMAND} ${WASMTIME_CARGO_BINARY} build ${WASMTIME_BUILD_TYPE_FLAG} ${WASMTIME_BUILD_TARGET}
BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}
BUILD_ALWAYS ON
BUILD_BYPRODUCTS ${WASMTIME_BUILD_PRODUCT})
Expand Down

0 comments on commit 181d005

Please sign in to comment.