ohos_ndk_env

Crates.ioohos_ndk_env
lib.rsohos_ndk_env
version0.1.4
sourcesrc
created_at2024-02-27 05:05:42.659022
updated_at2024-02-27 14:17:54.990219
descriptionset ohos build env for cc
homepage
repository
max_upload_size
id1154533
size4,056
lubinglun (lubinglun)

documentation

README

Add denpendencies

//Cargo.toml

[build-dependencies]
...
ohos_ndk_env = { version = "*" }

Use crate

// build.rs
extern ohos_ndk_env
fn main() {
    ohos_ndk_env::setup_ohos_ndk_env();
    let mut build = cc::Build::new();
    build.file("src/hello.c");
    build.compile("hello");
    println!("cargo:rerun-if-changed=src/hello.c");
    ...
}

Build

OHOS_NDK_HOME="/path/to/ohos-sdk/linux" cargo +nightly build

Commit count: 0

cargo fmt