open-coroutine 0.0.6

The open-coroutine is a simple, efficient and generic stackful-coroutine library.
use std::env;
use std::path::PathBuf;

fn main() {
    let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
    let deps = out_dir
        .parent()
        .unwrap()
        .parent()
        .unwrap()
        .parent()
        .unwrap()
        .join("deps");
    let dylib = env::current_dir().unwrap().join("dylib");
    //copy and link hook dylib
    if cfg!(target_os = "linux") {
        std::fs::copy(dylib.join("libhook.so"), deps.join("libhook.so"))
            .expect("copy libhook.so failed!");
        println!("cargo:rustc-link-lib=dylib=hook");
    } else if cfg!(all(target_os = "macos", target_arch = "aarch64")) {
        std::fs::copy(
            dylib.join("libhook-m1.dylib"),
            deps.join("libhook-m1.dylib"),
        )
        .expect("copy libhook-m1.dylib failed!");
        println!("cargo:rustc-link-lib=dylib=hook-m1");
    } else if cfg!(all(target_os = "macos", target_arch = "x86_64")) {
        std::fs::copy(dylib.join("libhook.dylib"), deps.join("libhook.dylib"))
            .expect("copy libhook.dylib failed!");
    } else if cfg!(target_os = "windows") {
        //todo test this
        std::fs::copy(dylib.join("hook.dll"), deps.join("hook.dll"))
            .expect("copy hook.dll failed!");
        println!("cargo:rustc-link-lib=dylib=hook");
    } else {
        panic!("unsupported platform ! Please submit a issue to https://github.com/acl-dev/open-coroutine/issues");
    }
}