Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying cfg expressions for lib targets #4900

Closed
ghost opened this issue Jan 5, 2018 · 2 comments
Closed

Allow specifying cfg expressions for lib targets #4900

ghost opened this issue Jan 5, 2018 · 2 comments
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.

Comments

@ghost
Copy link

ghost commented Jan 5, 2018

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 to Cargo.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 under lib breaks toodlext, with cargo build complaining that it can't find the toodle crate (kitcambridge/sync-storage-prototype#1).

/cc @fluffyemily

@alexcrichton alexcrichton added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Jan 5, 2018
fitzgen added a commit to fitzgen/cargo that referenced this issue May 8, 2018
@epage epage added A-cross-compiling Area: using --target flag for other platforms A-manifest Area: Cargo.toml issues labels Oct 17, 2023
@epage
Copy link
Contributor

epage commented Oct 17, 2023

The thing I'm wondering is if it is best to handle this in a single package or to have different packages that exhibit the behavior needed for each of those platforms.

@epage epage added S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request. T-infra Team: infrastructure labels Oct 17, 2023
@epage epage removed the T-infra Team: infrastructure label Oct 31, 2023
@epage
Copy link
Contributor

epage commented Oct 31, 2023

It looks like #12260 is a duplicate of this but #12260 has more discussion, so closing in favor of that. If there is anything I overlooked, let us know!

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants