Skip to content

Commit

Permalink
Only build supported terminals
Browse files Browse the repository at this point in the history
  • Loading branch information
swsnr committed Aug 25, 2018
1 parent 4f94575 commit 544943a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
### Changed
- Refactor internal terminal representation, replacing the terminal enum with a
new `Terminal` trait and dynamic dispatch.
- Only include terminal backends supported on the platform.

[GH-34]: https://github.com/lunaryorn/mdcat/pull/34

Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ version = "0.8.1-pre"
categories = ["command-line-utilities", "text-processing"]
license = "Apache-2.0"
authors = ["Sebastian Wiesner <sebastian@swsnr.de>"]
build = "build.rs"

[badges]
travis-ci = { repository = "lunaryorn/mdcat" }
maintenance = { status = "actively-developed" }

[features]
default = ["iterm2", "terminology"]
default = []

iterm2 = ["mime", "base64"]
terminology = ["immeta"]
Expand Down
28 changes: 28 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2018 Sebastian Wiesner <sebastian@swsnr.de>

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

fn enable_feature(feature: &str) {
println!("rustc-cfg={}", feature);
}

fn main() {
#[cfg(target_os = "macos")]
{
enable_feature("iterm2");
}
#[cfg(all(unix, not(target_os = "macos")))]
{
enable_feature("terminology");
}
}

0 comments on commit 544943a

Please sign in to comment.