Skip to content

Commit

Permalink
Cargoify
Browse files Browse the repository at this point in the history
Doesn't replace the Makefiles, but lets other projects
use gfx-rs in an easy way.

Closes gfx-rs#110
  • Loading branch information
emberian committed Jul 26, 2014
1 parent fa04cb7 commit e898b24
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/examples/
/lib/
/test/
/target/
26 changes: 26 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]

name = "gfx"
version = "0.1.0"
authors = [
"Brendan Zabarauskas <bjzaba@yahoo.com.au>",
"Corey Richardson <corey@octayn.net>",
"Dzmitry Malyshau <kvarkus@gmail.com>",
]

[[lib]]
name = "gfx"
path = "src/gfx/lib.rs"

[[lib]]
name = "gfx_macros"
path = "src/gfx_macros"

[dependencies.device]
path = "src/device/"

[dependencies.render]
path = "src/render/"

[dependencies.glfw_platform]
path = "src/glfw_platform"
13 changes: 13 additions & 0 deletions src/comm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]

name = "comm"
version = "0.1.0"
authors = [
"Brendan Zabarauskas <bjzaba@yahoo.com.au>",
"Corey Richardson <corey@octayn.net>",
"Dzmitry Malyshau <kvarkus@gmail.com>",
]

[[lib]]
name = "comm"
path = "lib.rs"
19 changes: 19 additions & 0 deletions src/device/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]

name = "device"
version = "0.1.0"
authors = [
"Brendan Zabarauskas <bjzaba@yahoo.com.au>",
"Corey Richardson <corey@octayn.net>",
"Dzmitry Malyshau <kvarkus@gmail.com>",
]

[[lib]]
name = "device"
path = "lib.rs"

[dependencies.comm]
path = "../comm/"

[dependencies.gl]
git = "https://github.com/bjz/gl-rs.git"
6 changes: 3 additions & 3 deletions src/device/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
extern crate libc;
extern crate comm;

#[cfg(gl)] pub use gl::GlBackEnd;
#[cfg(gl)] pub use dev = self::gl;
pub use gl::GlBackEnd;
pub use dev = self::gl;
// #[cfg(d3d11)] ... // TODO

use std::fmt;
Expand All @@ -37,7 +37,7 @@ pub mod rast;
pub mod shade;
pub mod target;
pub mod tex;
#[cfg(gl)] mod gl;
mod gl;

#[deriving(Show)]
pub struct Capabilities {
Expand Down
2 changes: 0 additions & 2 deletions src/gfx/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
extern crate libc;

extern crate device;
#[cfg(glfw)]
extern crate glfw_platform;
extern crate render;

Expand All @@ -42,7 +41,6 @@ pub use device::target::{PlaneEmpty, PlaneSurface, PlaneTexture, PlaneTextureLay
pub use device::{Blob, Device, GlBackEnd, GlProvider, GraphicsContext, InitError, QueueSize};
pub use device::shade::{UniformValue, ValueI32, ValueF32, ValueI32Vec, ValueF32Vec, ValueF32Matrix};
pub use device::shade::{ShaderSource, StaticBytes};
#[cfg(glfw)]
pub use glfw = glfw_platform;


Expand Down
13 changes: 13 additions & 0 deletions src/gfx_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]

name = "gfx_macros"
version = "0.1.0"
authors = [
"Brendan Zabarauskas <bjzaba@yahoo.com.au>",
"Corey Richardson <corey@octayn.net>",
"Dzmitry Malyshau <kvarkus@gmail.com>",
]

[[lib]]
name = "gfx_macros"
path = "lib.rs"
16 changes: 16 additions & 0 deletions src/glfw_platform/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]

name = "glfw_platform"
version = "0.1.0"
authors = [
"Brendan Zabarauskas <bjzaba@yahoo.com.au>",
"Corey Richardson <corey@octayn.net>",
"Dzmitry Malyshau <kvarkus@gmail.com>",
]

[[lib]]
name = "glfw_platform"
path = "lib.rs"

[dependencies.glfw]
git = "https://github.com/bjz/glfw-rs.git"
16 changes: 16 additions & 0 deletions src/render/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]

name = "render"
version = "0.1.0"
authors = [
"Brendan Zabarauskas <bjzaba@yahoo.com.au>",
"Corey Richardson <corey@octayn.net>",
"Dzmitry Malyshau <kvarkus@gmail.com>",
]

[[lib]]
name = "render"
path = "lib.rs"

[dependencies.device]
path = "../device/"

0 comments on commit e898b24

Please sign in to comment.