Skip to content

Commit

Permalink
Restrict compilation of borrowed handles on Android (#117)
Browse files Browse the repository at this point in the history
* Unbreak android

* Change android runs to checks
  • Loading branch information
notgull committed Mar 30, 2023
1 parent 1e5f09d commit cda3912
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:

tests:
name: Tests
# Note: `raw-window-handle` doesn't have any `#[cfg(...)]` guards, so
# we don't bother testing on other platforms
# `raw-window-handle` only has `cfg` guards for Android, so we just run Ubuntu
# and manually test Android
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -40,8 +40,19 @@ jobs:
with:
rust-version: ${{ matrix.rust_version }}

- run: rustup target add x86_64-linux-android

- name: Check documentation
run: cargo doc --no-deps --document-private-items

- name: Run tests
run: cargo test --verbose

- name: Run tests with std
run: cargo test --verbose --features std

- name: Check on Android
run: cargo check --verbose --target x86_64-linux-android

- name: Check on Android with std
run: cargo check --verbose --target x86_64-linux-android --features std
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ extern crate std;

mod android;
mod appkit;
#[cfg(any(feature = "std", not(target_os = "android")))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", not(target_os = "android")))))]
mod borrowed;
mod haiku;
mod redox;
Expand All @@ -43,6 +45,7 @@ mod windows;

pub use android::{AndroidDisplayHandle, AndroidNdkWindowHandle};
pub use appkit::{AppKitDisplayHandle, AppKitWindowHandle};
#[cfg(any(feature = "std", not(target_os = "android")))]
pub use borrowed::{
Active, ActiveHandle, DisplayHandle, HandleError, HasDisplayHandle, HasWindowHandle,
WindowHandle,
Expand Down

0 comments on commit cda3912

Please sign in to comment.