diff --git a/cmake/Rust.cmake b/cmake/Rust.cmake index 3ec5482e6..99ceb6b6c 100644 --- a/cmake/Rust.cmake +++ b/cmake/Rust.cmake @@ -37,7 +37,8 @@ if(DEFINED ASAN) endif() corrosion_import_crate( - MANIFEST_PATH "${CMAKE_SOURCE_DIR}/fish-rust/Cargo.toml" + MANIFEST_PATH "${CMAKE_SOURCE_DIR}/Cargo.toml" + CRATES "fish-rust" FEATURES "${FISH_CRATE_FEATURES}" FLAGS "${CARGO_FLAGS}" ) diff --git a/cmake/Tests.cmake b/cmake/Tests.cmake index 5e900741e..4061a6b20 100644 --- a/cmake/Tests.cmake +++ b/cmake/Tests.cmake @@ -193,8 +193,8 @@ endif() if(NOT DEFINED ASAN) add_test( NAME "cargo-test" - COMMAND cargo test ${CARGO_FLAGS} --target-dir target ${cargo_target_opt} - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/fish-rust" + COMMAND cargo test ${CARGO_FLAGS} --package fish-rust --target-dir target ${cargo_target_opt} + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" ) set_tests_properties("cargo-test" PROPERTIES SKIP_RETURN_CODE ${SKIP_RETURN_CODE}) add_test_target("cargo-test") @@ -202,7 +202,7 @@ endif() add_test( NAME "cargo-test-widestring" - COMMAND cargo test ${CARGO_FLAGS} --target-dir target ${cargo_target_opt} - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/fish-rust/widestring-suffix/" + COMMAND cargo test ${CARGO_FLAGS} --package widestring-suffix --target-dir target ${cargo_target_opt} + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" ) add_test_target("cargo-test-widestring") diff --git a/fish-rust/build.rs b/fish-rust/build.rs index 507db90e1..06335c826 100644 --- a/fish-rust/build.rs +++ b/fish-rust/build.rs @@ -6,7 +6,7 @@ fn main() { let rust_dir = std::env::var("CARGO_MANIFEST_DIR").expect("Env var CARGO_MANIFEST_DIR missing"); let target_dir = - std::env::var("FISH_RUST_TARGET_DIR").unwrap_or(format!("{}/{}", rust_dir, "target/")); + std::env::var("FISH_RUST_TARGET_DIR").unwrap_or(format!("{}/../{}", rust_dir, "target/")); let fish_src_dir = format!("{}/{}", rust_dir, "../src/"); // Where cxx emits its header.