Skip to content

Commit

Permalink
Support build target wasm32-unknown-emscripten (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanTsune authored Jan 9, 2024
1 parent 8e1b33d commit 072f9f7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,15 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [wasm32-unknown-unknown]
include:
- target: wasm32-unknown-unknown
os: ubuntu-latest
- target: wasm32-unknown-emscripten
os: ubuntu-latest
- target: wasm32-unknown-emscripten
os: windows-latest
- target: wasm32-unknown-emscripten
os: macos-latest
runs-on: ubuntu-latest
steps:
- name: Install rust
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub use crate::ansi::{strip_ansi_codes, AnsiCodeIterator};
mod common_term;
mod kb;
mod term;
#[cfg(unix)]
#[cfg(all(unix, not(target_arch = "wasm32")))]
mod unix_term;
mod utils;
#[cfg(target_arch = "wasm32")]
Expand Down
4 changes: 2 additions & 2 deletions src/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl<'a> TermFeatures<'a> {
{
TermFamily::WindowsConsole
}
#[cfg(unix)]
#[cfg(all(unix, not(target_arch = "wasm32")))]
{
TermFamily::UnixTerm
}
Expand Down Expand Up @@ -624,7 +624,7 @@ impl<'a> Read for &'a Term {
}
}

#[cfg(unix)]
#[cfg(all(unix, not(target_arch = "wasm32")))]
pub use crate::unix_term::*;
#[cfg(target_arch = "wasm32")]
pub use crate::wasm_term::*;
Expand Down

0 comments on commit 072f9f7

Please sign in to comment.