I have crate-a which is a dependency for crate-b. crate-a's build script copies some header files(.h) to /target/build/crate-a-xxx/out/include/ which I need to use during crate-b's build(building c files). how do i refer dir /target/build/crate-a-xxx/out/include/ in crate-b/build.rs through some env variable.
the dependency crate needs a links key in its cargo manifest, then its build script can set metadata, which can be read by the build script of immediate dependent crate (not transitive dependents).
Just be aware that there can only be a single package with a given links value inside the dependency graph. Otherwise cargo will throw an error.
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.