Skip to content

Commit b8999cc

Browse files
authoredMar 15, 2022
Add support for Android and iOS (#7)
1 parent 534ef10 commit b8999cc

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed
 

‎.github/workflows/build.yaml

+10-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ on:
2727
jobs:
2828
check:
2929
name: Type checking (${{ matrix.target.name }})
30-
runs-on: ubuntu-latest
30+
runs-on: ${{ matrix.target.host }}
3131
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) || github.event_name == 'push' }}
3232
strategy:
3333
matrix:
@@ -36,10 +36,19 @@ jobs:
3636
# triple: x86_64-pc-windows-gnu
3737
- name: Linux
3838
triple: x86_64-unknown-linux-gnu
39+
host: ubuntu-latest
40+
- name: Android
41+
triple: aarch64-linux-android
42+
host: ubuntu-latest
3943
- name: macOS
4044
triple: x86_64-apple-darwin
45+
host: macos-latest
46+
- name: iOS
47+
triple: aarch64-apple-ios
48+
host: macos-latest
4149
- name: FreeBSD
4250
triple: x86_64-unknown-freebsd
51+
host: ubuntu-latest
4352

4453
steps:
4554
- name: Checkout sources

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Unreleased
2+
- Added support for Android
3+
- Added support for iOS
4+
15
# 0.1.4
26

37
- Modified MacOS implementation to be friendly towards Apple app store review guidelines.

‎Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ targets = ["x86_64-unknown-linux-gnu"]
1414

1515
[dependencies]
1616

17-
[target.'cfg(any(target_os = "macos", target_os = "freebsd"))'.dependencies]
17+
[target.'cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd"))'.dependencies]
1818
libc = "0.2.107"

‎src/macos.rs ‎src/apple.rs

File renamed without changes.

‎src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
33
use std::num::NonZeroUsize;
44

5-
#[cfg_attr(target_os = "linux", path = "linux.rs")]
5+
#[cfg_attr(any(target_os = "linux", target_os = "android"), path = "linux.rs")]
66
#[cfg_attr(target_os = "freebsd", path = "freebsd.rs")]
7-
#[cfg_attr(target_os = "macos", path = "macos.rs")]
7+
#[cfg_attr(any(target_os = "macos", target_os = "ios"), path = "apple.rs")]
88
mod imp;
99

1010
/// Obtain the number of threads currently part of the active process. Returns `None` if the number

0 commit comments

Comments
 (0)
Please sign in to comment.