diff --git a/.gitignore b/.gitignore index 6936990..7a4bf0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target **/*.rs.bk Cargo.lock +third-party diff --git a/Cargo.toml b/Cargo.toml index b47da53..a0f3a6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,10 +2,15 @@ name = "rusty" version = "0.1.0" authors = ["Thomas Forgione "] +build = "prepare/build.rs" [dependencies] sfml = "0.14.0" +[build-dependencies] +git2 = "0.7.5" +cmake = "0.1" + [[bin]] name = "rusty-maker" path = "src/app/game.rs" diff --git a/prepare/build.rs b/prepare/build.rs new file mode 100644 index 0000000..c07cd58 --- /dev/null +++ b/prepare/build.rs @@ -0,0 +1,22 @@ +extern crate git2; + +use git2::Repository; + +fn main() { + let sfml = match Repository::open("third-party/sfml") { + Ok(repo) => repo, + Err(_) => { + Repository::clone("https://github.com/sfml/sfml", "third-party/sfml") + .expect("Couldn't clone SFML") + } + }; + + let csfml = match Repository::open("third-party/csfml") { + Ok(repo) => repo, + Err(_) => { + Repository::clone("https://github.com/sfml/csfml", "third-party/csfml") + .expect("Couldn't clone CSFML") + } + }; + +}