()
| 189 | } |
| 190 | |
| 191 | fn main() { |
| 192 | // note: all link symbol names in x86 (32-bit) are prefixed wth "_". |
| 193 | // run "rustup show" to show current default toolchain, if it is stable-x86-pc-windows-msvc, |
| 194 | // please install x64 toolchain by "rustup toolchain install stable-x86_64-pc-windows-msvc", |
| 195 | // then set x64 to default by "rustup default stable-x86_64-pc-windows-msvc" |
| 196 | let target = target_build_utils::TargetInfo::new(); |
| 197 | if target.unwrap().target_pointer_width() != "64" { |
| 198 | // panic!("Only support 64bit system"); |
| 199 | } |
| 200 | env::remove_var("CARGO_CFG_TARGET_FEATURE"); |
| 201 | env::set_var("CARGO_CFG_TARGET_FEATURE", "crt-static"); |
| 202 | |
| 203 | find_package("libyuv"); |
| 204 | gen_vcpkg_package("libvpx", "vpx_ffi.h", "vpx_ffi.rs", "^[vV].*"); |
| 205 | gen_vcpkg_package("aom", "aom_ffi.h", "aom_ffi.rs", "^(aom|AOM|OBU|AV1).*"); |
| 206 | gen_vcpkg_package("libyuv", "yuv_ffi.h", "yuv_ffi.rs", ".*"); |
| 207 | |
| 208 | // there is problem with cfg(target_os) in build.rs, so use our workaround |
| 209 | let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); |
| 210 | if target_os == "ios" { |
| 211 | // nothing |
| 212 | } else if target_os == "android" { |
| 213 | println!("cargo:rustc-cfg=android"); |
| 214 | } else if cfg!(windows) { |
| 215 | // The first choice is Windows because DXGI is amazing. |
| 216 | println!("cargo:rustc-cfg=dxgi"); |
| 217 | } else if cfg!(target_os = "macos") { |
| 218 | // Quartz is second because macOS is the (annoying) exception. |
| 219 | println!("cargo:rustc-cfg=quartz"); |
| 220 | } else if cfg!(unix) { |
| 221 | // On UNIX we pray that X11 (with XCB) is available. |
| 222 | println!("cargo:rustc-cfg=x11"); |
| 223 | } |
| 224 | } |
nothing calls this directly
no test coverage detected