1 | mod android; |
---|---|
2 | mod macos; |
3 | mod wasi; |
4 | |
5 | pub fn setup() { |
6 | println!("cargo:rerun-if-env-changed=DEBUG_GENERATED_CODE"); |
7 | println!("cargo:rerun-if-env-changed=TYPE_DEF_TMP_PATH"); |
8 | println!("cargo:rerun-if-env-changed=CARGO_CFG_NAPI_RS_CLI_VERSION"); |
9 | match std::env::var(key:"CARGO_CFG_TARGET_OS").as_deref() { |
10 | Ok("macos") => { |
11 | macos::setup(); |
12 | } |
13 | Ok("android") => if android::setup().is_ok() {}, |
14 | Ok("wasi") => { |
15 | wasi::setup(); |
16 | } |
17 | _ => {} |
18 | } |
19 | } |
20 |