Skip to content

Commit

Permalink
cbindgen: Fix adding header dependency on cargo-build
Browse files Browse the repository at this point in the history
If headers are generated with cbindgen, they should
probably always be available if the rust crate is also
available, so it makes sense to add a dependency.
The changed line was supposed to already do exactly that,
however interface targets are not actually built,
so we need to directly depend on the cargo-build_
custom command that generates the Rust library.
We already do this in other places, it was just
overlooked here.
  • Loading branch information
jschwe committed Jan 12, 2025
1 parent 6b0c1a9 commit 4833136
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmake/Corrosion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2119,6 +2119,9 @@ function(corrosion_experimental_cbindgen)
)
add_dependencies("_corrosion_cbindgen_${cbindgen_bindings_target}_bindings" "_corrosion_cbindgen_${cbindgen_bindings_target}_bindings_${header_identifier}")
add_dependencies(${cbindgen_bindings_target} "_corrosion_cbindgen_${cbindgen_bindings_target}_bindings")
if(TARGET "${CCN_TARGET}")
add_dependencies(cargo-build_${CCN_TARGET} "_corrosion_cbindgen_${cbindgen_bindings_target}_bindings")
endif()
endfunction()

# Parse the version of a Rust package from it's package manifest (Cargo.toml)
Expand Down

0 comments on commit 4833136

Please sign in to comment.