diff options
author | Akshay <nerdy@peppe.rs> | 2020-07-23 23:06:22 +0530 |
---|---|---|
committer | Akshay <nerdy@peppe.rs> | 2020-07-23 23:06:22 +0530 |
commit | d7c303dda4750a432478c94b3ed41bca1352d839 (patch) | |
tree | dccaba932e18a1414d91a67246fba3e0890d27f0 | |
parent | 2f47f50b0382491099391185c6a2702b1370b206 (diff) |
enable feature based compilation to support windowsv0.2.2-alpha
-rw-r--r-- | .github/workflows/main.yml | 6 | ||||
-rw-r--r-- | Cargo.toml | 5 | ||||
-rw-r--r-- | src/main.rs | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e2995b8..5c3e6f9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,7 +39,7 @@ jobs: && sudo apt-get install -y \ libdbus-1-dev - name: Build - run: cargo build --all --release && strip target/release/dijo + run: cargo build -all --no-default-features --features unix --release && strip target/release/dijo - name: Upload binaries to release uses: svenstaro/upload-release-action@v1-release @@ -72,7 +72,7 @@ jobs: override: true - name: Build for mac - run: cargo build --all --release && strip target/release/dijo + run: cargo build --all --no-default-features --features unix --release && strip target/release/dijo - name: Upload binaries to release uses: svenstaro/upload-release-action@v1-release @@ -106,7 +106,7 @@ jobs: - name: Build for windows run: | - cargo build --all --release + cargo build --all --no-default-features --features windows --release strip target/release/dijo - name: Upload binaries to release @@ -23,7 +23,10 @@ notify = "4.0" [dependencies.cursive] version = "0.15" default-features = false -features = ["termion-backend", "crossterm-backend"] + +[features] +unix = ["cursive/termion-backend"] +windows = ["cursive/crossterm-backend"] [dependencies.chrono] version = "0.4" diff --git a/src/main.rs b/src/main.rs index dec3156..609738e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ use crate::utils::{load_configuration_file, AppConfig}; use clap::{App as ClapApp, Arg}; -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "macos"))] use cursive::termion; #[cfg(target_os = "windows")] @@ -71,7 +71,7 @@ fn main() { #[cfg(target_os = "windows")] let mut s = crossterm().unwrap(); - #[cfg(target_os = "linux")] + #[cfg(any(target_os = "linux", target_os = "macos"))] let mut s = termion().unwrap(); let app = App::load_state(); |