Skip to content

Commit

Permalink
Enable output_vt100 and ctor on Windows targets only
Browse files Browse the repository at this point in the history
  • Loading branch information
nbouteme committed Feb 20, 2019
1 parent 98182f7 commit b2c70fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ travis-ci = { repository = "colin-kiegel/rust-pretty-assertions" }
[dependencies]
difference = "2.0.0"
ansi_term = "0.11"

[target.'cfg(windows)'.dependencies]
output_vt100 = "0.1"
ctor = "0.1.7"
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@

extern crate difference;
extern crate ansi_term;

#[cfg(windows)]
extern crate output_vt100;
#[cfg(windows)]
extern crate ctor;

mod format_changeset;

use std::fmt::{self, Debug, Display};
Expand All @@ -77,7 +81,9 @@ use difference::Changeset;
use format_changeset::format_changeset;
pub use ansi_term::Style;

#[cfg(windows)]
use ctor::*;
#[cfg(windows)]
#[ctor]
fn init() {
output_vt100::init();
Expand Down

0 comments on commit b2c70fe

Please sign in to comment.