diff options
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 25 |
1 files changed, 11 insertions, 14 deletions
@@ -14,10 +14,10 @@ #[cfg(windows)] use embed_resource; #[cfg(windows)] -use tempfile; -#[cfg(windows)] use reqwest; #[cfg(windows)] +use tempfile; +#[cfg(windows)] use zip; use gl_generator::{Api, Fallbacks, GlobalGenerator, Profile, Registry}; @@ -27,24 +27,20 @@ use std::fs::File; use std::path::Path; #[cfg(windows)] -use std::io; -#[cfg(windows)] use std::fs::OpenOptions; +#[cfg(windows)] +use std::io; #[cfg(windows)] -const WINPTY_PACKAGE_URL: &str = "https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip"; +const WINPTY_PACKAGE_URL: &str = + "https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip"; fn main() { let dest = env::var("OUT_DIR").unwrap(); let mut file = File::create(&Path::new(&dest).join("gl_bindings.rs")).unwrap(); - Registry::new( - Api::Gl, - (4, 5), - Profile::Core, - Fallbacks::All, - ["GL_ARB_blend_func_extended"], - ).write_bindings(GlobalGenerator, &mut file) + Registry::new(Api::Gl, (4, 5), Profile::Core, Fallbacks::All, ["GL_ARB_blend_func_extended"]) + .write_bindings(GlobalGenerator, &mut file) .unwrap(); #[cfg(windows)] @@ -68,7 +64,8 @@ fn aquire_winpty_agent(out_path: &Path) { .read(true) .write(true) .create(true) - .open(tmp_dir.path().join("winpty_package.zip")).unwrap(); + .open(tmp_dir.path().join("winpty_package.zip")) + .unwrap(); io::copy(&mut response, &mut file).unwrap(); @@ -77,7 +74,7 @@ fn aquire_winpty_agent(out_path: &Path) { let target = match env::var("TARGET").unwrap().split("-").next().unwrap() { "x86_64" => "x64", "i386" => "ia32", - _ => panic!("architecture has no winpty binary") + _ => panic!("architecture has no winpty binary"), }; let mut winpty_agent = archive.by_name(&format!("{}/bin/winpty-agent.exe", target)).unwrap(); |