Skip to content

Commit

Permalink
Auto merge of servo#430 - servo:derive, r=Manishearth
Browse files Browse the repository at this point in the history
Switch to serde_derive

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/430)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo authored Oct 7, 2016
2 parents 98e7331 + 94437c4 commit 3597a9d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
6 changes: 3 additions & 3 deletions webrender/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "webrender"
version = "0.5.1"
version = "0.6.0"
authors = ["Glenn Watson <[email protected]>"]
license = "MPL-2.0"
repository = "https://github.com/servo/webrender"

[features]
default = ["webrender_traits/serde_codegen"]
serde_macros = ["webrender_traits/serde_macros"]
default = ["webrender_traits/codegen"]
serde_derive = ["webrender_traits/serde_derive"]

[dependencies]
app_units = "0.3"
Expand Down
13 changes: 8 additions & 5 deletions webrender_traits/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[package]
name = "webrender_traits"
version = "0.5.1"
version = "0.6.0"
authors = ["Glenn Watson <[email protected]>"]
license = "MPL-2.0"
repository = "https://github.com/servo/webrender"
build = "build.rs"

[features]
default = ["serde_codegen"]
default = ["codegen"]
nightly = ["euclid/unstable", "serde/unstable"]
codegen = ["serde_codegen", "serde_codegen/with-syntex"]

[dependencies]
app_units = "0.3.0"
Expand All @@ -18,11 +19,13 @@ gleam = "0.2.22"
heapsize = "0.3.6"
offscreen_gl_context = {version = "0.4.0", features = ["serde_serialization"]}
serde = "0.8"
serde_macros = {version = "0.8", optional = true}
serde_derive = {version = "0.8", optional = true}
ipc-channel = "0.5.0"

[target.x86_64-apple-darwin.dependencies]
core-graphics = "0.4"

[build-dependencies]
serde_codegen = {version = "0.8", optional = true}
[build-dependencies.serde_codegen]
version = "0.8"
default_features = false
optional = true
16 changes: 8 additions & 8 deletions webrender_traits/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#[cfg(all(feature = "serde_codegen", not(feature = "serde_macros")))]
#[cfg(all(feature = "serde_codegen", not(feature = "serde_derive")))]
mod inner {
extern crate serde_codegen;

Expand All @@ -20,24 +20,24 @@ mod inner {
}
}

#[cfg(all(feature = "serde_macros", not(feature = "serde_codegen")))]
#[cfg(all(feature = "serde_derive", not(feature = "serde_codegen")))]
mod inner {
pub fn main() {}
}

#[cfg(all(feature = "serde_codegen", feature = "serde_macros"))]
#[cfg(all(feature = "serde_codegen", feature = "serde_derive"))]
mod inner {
pub fn main() {
panic!("serde_codegen and serde_macros are both used. "
"You probably forgot --no-default-features.")
panic!("serde_codegen and serde_derive are both used. \
You probably forgot --no-default-features.")
}
}

#[cfg(not(any(feature = "serde_codegen", feature = "serde_macros")))]
#[cfg(not(any(feature = "serde_codegen", feature = "serde_derive")))]
mod inner {
pub fn main() {
panic!("Neither serde_codegen nor serde_macros are used. "
"You probably want --features serde_macros --no-default-features.")
panic!("Neither serde_codegen nor serde_derive are used. "
"You probably want --features serde_derive --no-default-features.")
}
}

Expand Down
8 changes: 5 additions & 3 deletions webrender_traits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#![cfg_attr(feature = "nightly", feature(nonzero))]
#![cfg_attr(feature = "serde_macros", feature(custom_derive, plugin))]
#![cfg_attr(feature = "serde_macros", plugin(serde_macros))]
#![cfg_attr(feature = "serde_derive", feature(rustc_attrs, rustc_macro, structural_match))]

extern crate app_units;
extern crate byteorder;
Expand All @@ -16,13 +15,16 @@ extern crate heapsize;
extern crate ipc_channel;
extern crate offscreen_gl_context;
extern crate serde;
#[cfg(feature = "serde_derive")]
#[macro_use]
extern crate serde_derive;

#[cfg(target_os = "macos")] extern crate core_graphics;

#[cfg(feature = "serde_codegen")]
include!(concat!(env!("OUT_DIR"), "/types.rs"));

#[cfg(feature = "serde_macros")]
#[cfg(feature = "serde_derive")]
include!("types.rs");

mod api;
Expand Down

0 comments on commit 3597a9d

Please sign in to comment.