I want to know if there is a way in the build script to tell the Cargo.toml, "this is the name of your lib." I saw that for binaries, there is CARGO_BIN_NAME, but there doesn't seem to be an equivalent for libs.
Does anyone know a way to work around this?
CARGO_CRATE_NAME â The name of the crate that is currently being compiled. It is the name of the Cargo target with - converted to _, such as the name of the library, binary, example, integration test, or benchmark.
Note: CARGO_BIN_NAME and CARGO_CRATE_NAME are environment variables that Cargo sets for crates[1] rather than build script sets for Cargo.
which means you can write env!("CARGO_CRATE_NAME"); in source code of your crate âŠī¸