Skip to content

Commit

Permalink
Made builds work on Windows/Mac, and updated Mockall.
Browse files Browse the repository at this point in the history
Signed-off-by: Julia DeMille <me@jdemille.com>
  • Loading branch information
judemille committed Dec 23, 2023
1 parent 25a850e commit 9a9002c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
XPlaneSDK/** linguist-vendored
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ edition = "2021"

[dependencies]
bitfield = "0.14"
mockall = { version = "0.11", optional = true }
mockall = { version = "~0.12", optional = true }

[build-dependencies]
bindgen = "0.69"
Expand Down
40 changes: 22 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![docs.rs](https://img.shields.io/docsrs/xplane-sys)](https://docs.rs/xplane-sys) [![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/judemille/xplane-sys/rust.yml)](https://github.com/judemille/xplane-sys/actions)

# xplane-sys: Rust bindings for the X-Plane plugin SDK

This library provides Rust bindings to the X-Plane plugin SDK.
Expand All @@ -8,11 +9,11 @@ This library provides Rust bindings to the X-Plane plugin SDK.
This crate is based on SDK version 4.0.1 (XPLM400), supporting X-Plane 12.04 and newer. Plugins made with this crate
can be used with earlier versions of X-Plane, so long as the right feature gates are set. The gates are as follows:

* `XPLM400` -- X-Plane 12.04 and newer.
* `XPLM303` -- X-Plane 11.50 and newer.
* `XPLM301` -- X-Plane 11.20 and newer.
* `XPLM300` -- X-Plane 11.10 and newer.
* `XPLM210` -- X-Plane 10.20 and newer. (actually 10.00 and newer, but this crate forbids 32-bit plugins.)
- `XPLM400` -- X-Plane 12.04 and newer.
- `XPLM303` -- X-Plane 11.50 and newer.
- `XPLM301` -- X-Plane 11.20 and newer.
- `XPLM300` -- X-Plane 11.10 and newer.
- `XPLM210` -- X-Plane 10.20 and newer. (actually 10.00 and newer, but this crate forbids 32-bit plugins.)

Unlike the X-Plane C SDK, this crate automatically infers older versions from requesting a newer version, so no need
to define all the versions up to your desired version. Features from SDK versions newer than the requested version *can*
Expand Down Expand Up @@ -42,28 +43,30 @@ provide stub implementations of the SDK functions. This crate includes those
libraries and tells Cargo to link them.

## Disclaimer

The current maintainer of this project is a trans lesbian who unequivocally supports Ukraine,
and opposes any and all human rights violations.

### *You should not use this project if you:*
* Do not unequivocally support the LGBTQ+ population, including transgender individuals.
* Think that LGBTQ+ people "shouldn't put it out on display"
* Support "drop the T", TERF, or similar movements.
* Think that pedophilia is included in LGBTQ+, either because you want it to be included, or you think
that the community accepts it. It does not accept it.
* Refuse to address and refer to people with their preferred name, pronouns, and gender labels.
* Do not support Ukraine's struggle against their Russian oppressors.
* Support any far-right parties or politicians (including Vladimir Putin, the GOP, AfD, FdI, and similar)

I cannot stop you, but anyone observed to meet the above listed criteria interacts with the project

- Do not unequivocally support the LGBTQ+ population, including transgender individuals.
- Think that LGBTQ+ people "shouldn't put it out on display"
- Support "drop the T", TERF, or similar movements.
- Think that pedophilia is included in LGBTQ+, either because you want it to be included, or you think
that the community accepts it. It does not accept it.
- Refuse to address and refer to people with their preferred name, pronouns, and gender labels.
- Do not support Ukraine's struggle against their Russian oppressors.
- Support any far-right parties or politicians (including Vladimir Putin, the GOP, AfD, FdI, and similar)

I cannot stop you, but anyone observed to meet the above listed criteria who interacts with the project
will be blocked from posting issues or pull requests.

## License

Licensed under either of

* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)

at your option.

Expand All @@ -79,4 +82,5 @@ additional terms or conditions.
## Unit Testing

The `mockall` feature of this crate is intended to be enabled when unit testing a crate that uses this crate.
All functions will be mocked, using [mockall.](https://github.com/asomers/mockall)
All functions will be mocked, using [mockall.](https://github.com/asomers/mockall) This crate currently exposes
`mockall = "~0.12"`.
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn handle_platform(crate_path: &Path) {
Environment::Msvc,
"Unsupported environment! X-Plane uses the MSVC ABI. Compile for that target."
);
let library_path = crate_path.join("SDK/Libraries/Win");
let library_path = crate_path.join("XPlaneSDK/Libraries/Win");
println!("cargo:rustc-link-search={}", library_path.to_str().unwrap());
println!("cargo:rustc-link-lib=XPLM_64");
println!("cargo:rustc-link-lib=XPWidgets_64");
Expand All @@ -70,7 +70,7 @@ fn handle_platform(crate_path: &Path) {
Architecture::Aarch64(_) | Architecture::X86_64 => {}
_ => panic!("Unsupported target architecture! xplane-sys on Mac only supports x86_64 or aarch64.")
};
let library_path = crate_path.join("SDK/Libraries/Mac");
let library_path = crate_path.join("XPlaneSDK/Libraries/Mac");
println!(
"cargo:rustc-link-search-framework=framework={}",
library_path.to_str().unwrap()
Expand Down

0 comments on commit 9a9002c

Please sign in to comment.