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

apk: Use rustc --crate-type=cdylib to always force a lib to be compiled #28

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ jobs:
run: cargo install --path cargo-apk

- name: Cargo apk build for target ${{ matrix.rust-target }}
run: cargo apk build -p examples --target ${{ matrix.rust-target }} --examples
run: |
cargo apk build -p examples --target ${{ matrix.rust-target }} --example hello_world
cargo apk build -p examples --target ${{ matrix.rust-target }} --example jni_audio
cargo apk build -p examples --target ${{ matrix.rust-target }} --example looper

- uses: actions/upload-artifact@v2
# Only need this for CI, unless users are interested in downloading
Expand Down
3 changes: 2 additions & 1 deletion cargo-apk/src/apk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ impl<'a> ApkBuilder<'a> {
self.min_sdk_version(),
self.cmd.target_dir(),
)?;
cargo.arg("build");
cargo.arg("rustc");
cargo.arg("--crate-type=cdylib");
if self.cmd.target().is_none() {
cargo.arg("--target").arg(triple);
}
Expand Down