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 37944ed
Show file tree
Hide file tree
Showing 9 changed files with 97 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/
25 changes: 25 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]

name = "gfx"
version = "0.1.0"
authors = ["Dzmitry Malyshau",
"Brendan Zabarauskas",
"Corey Richardson <corey@octayn.net>",
]

[[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"
10 changes: 10 additions & 0 deletions src/comm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]

name = "comm"
version = "0.1.0"
authors = ["Brendan Zabarauskas",
]

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

name = "device"
version = "0.1.0"
authors = ["Dzmitry Malyshau",
"Brendan Zabarauskas",
"Corey Richardson <corey@octayn.net>",
]

[[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
11 changes: 11 additions & 0 deletions src/gfx_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]

name = "gfx_macros"
version = "0.1.0"
authors = ["Dzmitry Malyshau",
"Brendan Zabarauskas",
]

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

name = "glfw_platform"
version = "0.1.0"
authors = ["Dzmitry Malyshau",
"Brendan Zabarauskas",
]

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

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

name = "render"
version = "0.1.0"
authors = ["Dzmitry Malyshau",
"Brendan Zabarauskas",
"Corey Richardson <corey@octayn.net>",
]

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

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

0 comments on commit 37944ed

Please sign in to comment.