sys-info 0.5.3

Get system information in Rust. For now it supports Linux, Mac OS X and Windows.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extern crate gcc;

use std::env;

fn main() {
    let target = env::var("TARGET").unwrap();
    let target_os = target.split('-').nth(2).unwrap();

    match target_os {
        "linux" => gcc::compile_library("libinfo.a", &["c/linux.c"]),
        "darwin" => gcc::compile_library("libinfo.a", &["c/macos.c"]),
        "windows" => {
            gcc::compile_library("libinfo.a", &["c/windows.c"]);
            println!("cargo:rustc-flags=-l psapi");
        },
        _ => panic!("Unsupported system")
    };
}