Allow specifying cfg
expressions for lib
targets
#4900
Labels
A-cross-compiling
Area: using --target flag for other platforms
A-manifest
Area: Cargo.toml issues
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-needs-info
Status: Needs more info, such as a reproduction or more background for a feature request.
Hi! It looks like it's not possible to specify architecture-specific fields for a
lib
target. I tried adding a[target.'cfg(any(target_os="android", target_os="ios"))'.lib]
section toCargo.toml
, as in mozilla/toodle#10 (comment), but Cargo warns that it's an unused manifest key.In case it helps, the crate in question,
toodle
, is a library that's cross-compiled for iOS and Android, and also imported as a regular Rust crate by another crate (toodlext
).crate-type = ["staticlib", "cdylib"]
seems to be necessary for cross-compiling (cargo lipo
fails without it), but leaving it underlib
breakstoodlext
, withcargo build
complaining that it can't find thetoodle
crate (kitcambridge/sync-storage-prototype#1)./cc @fluffyemily
The text was updated successfully, but these errors were encountered: