Closed LDeakin closed 3 months ago
Is there any reason why you can't use cargo vendor to download your required dependencies?
Maybe I am missing something, but it seems like cargo vendor
is a bit inconvenient to use as Cargo.toml
changes are needed.
I've ended up just doing the following with cargo fetch
:
FetchContent_Declare(example ...)
FetchContent_Populate(example)
get_property(CARGO_EXECUTABLE TARGET Rust::Cargo PROPERTY IMPORTED_LOCATION)
execute_process(COMMAND ${CARGO_EXECUTABLE} fetch --locked WORKING_DIRECTORY ${example_SOURCE_DIR})
corrosion_import_crate(MANIFEST_PATH ${example_SOURCE_DIR}/Cargo.toml FLAGS --frozen ...)
I use corrosion in environments where network access is available for
CMake
configuration, but not for building. Whilecorrosion_import_crate
can be run withFLAGS --offline
for an offline build, this fails if the dependencies have not been downloaded.I believe
cargo fetch
during configuration would make this possible. What are your thoughts on such a change/feature?