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.
CARGO_CRATE_NAME are environment variables that Cargo sets for crates rather than build script sets for Cargo.
that's not to change the binary name, that's set by cargo to inform the build script in case it need that information.
neither the library or binary names can be changed from a build script. they must be specified in the manifest.