Skip to content

Commit

Permalink
Do not install the versioned links and lib on Android
Browse files Browse the repository at this point in the history
The platform uses plain .so
  • Loading branch information
lu-zero committed May 3, 2024
1 parent 9c5c603 commit 2302749
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,10 @@ impl InstallTargetPaths {
}
}

fn load_manifest_capi_config(pkg: &Package) -> anyhow::Result<CApiConfig> {
fn load_manifest_capi_config(
pkg: &Package,
rustc_target: &target::Target,
) -> anyhow::Result<CApiConfig> {
let name = &pkg
.manifest()
.targets()
Expand Down Expand Up @@ -690,6 +693,10 @@ fn load_manifest_capi_config(pkg: &Package) -> anyhow::Result<CApiConfig> {
}
}

if rustc_target.os == "android" {
versioning = false;
}

let library = LibraryCApiConfig {
name: lib_name,
version,
Expand Down Expand Up @@ -920,7 +927,7 @@ fn compile_with_exec(

for unit in bcx.roots.iter() {
let pkg = &unit.pkg;
let capi_config = load_manifest_capi_config(pkg)?;
let capi_config = load_manifest_capi_config(pkg, rustc_target)?;
let name = &capi_config.library.name;
let install_paths = InstallPaths::new(name, args, &capi_config);
let pkg_rustflags = &capi_config.library.rustflags;
Expand Down Expand Up @@ -1007,7 +1014,7 @@ impl CPackage {
let id = pkg.package_id();
let version = pkg.version().clone();
let root_path = pkg.root().to_path_buf();
let capi_config = load_manifest_capi_config(pkg)?;
let capi_config = load_manifest_capi_config(pkg, rustc_target)?;

patch_target(pkg, libkinds, &capi_config)?;

Expand Down

0 comments on commit 2302749

Please sign in to comment.