Skip to content

Set --crate-type cdylib from the cmdline#80

Closed
Firestar99 wants to merge 3 commits intorust-mobile:mainfrom
Firestar99:cdylib_cmdline
Closed

Set --crate-type cdylib from the cmdline#80
Firestar99 wants to merge 3 commits intorust-mobile:mainfrom
Firestar99:cdylib_cmdline

Conversation

@Firestar99
Copy link

Instead of cargo build, you can use cargo rustc --crate-type dylib to specify the crate type you want the target crate (not it's dependencies) to be compiled to. All "main apk" crates can (but don't have to) remove the previously required declaration in Cargo.toml below:

[lib]
crate-type = ["dylib"]

This is entirely untested due to me not having the Android SDK installed, hoping that github actions will test it properly.

Also see rust-gpu's PR doing the exact same thing, where our Android build failed since I removed the explicit crate type everywhere.

@MarijnS95
Copy link
Member

MarijnS95 commented Dec 5, 2025

See also prior art in #28, where this was already tried and eventually rejected.

We can always re-evaluate, but it's worthwhile to at least have previous context linked and taken into account.

@MarijnS95 MarijnS95 closed this Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants