samcrow / rust-xplm

Rust interfaces to the X-Plane plugin SDK
Apache License 2.0
39 stars 15 forks source link

Docs don't include build instructions/hints #13

Closed JDeeth closed 8 months ago

JDeeth commented 8 months ago

Sorry if this is painfully obvious to everyone but me - could the examples and/or readme be extended to show how to implement this crate in your own project?

Something like:

Usage

cargo new --lib my-rxplm-project
cd my-rxplm-project
cargo add xplm

Then add to Cargo.toml:

[lib]
crate-type = ["cdylib"]

Copy minimal example into src/lib.rs

cargo build

Rename target/debug/my_rxplm_project.dll to win.xpl (or my_rxplm_project.so to lin.xpl, etc) and copy to the aircraft/scenery/sim plugins folder etc

Also might be worth mentioning the ease of cross-compilation e.g. with cross? I don't know if C++ has moved on a lot from when I last leaned into it, but it's hard to beat 1) install Podman (on a linux machine) 2) install cross 3) cross build --target x86_64-pc-windows-gnu 4) package and distribute the .dll :D

samcrow commented 8 months ago

Thanks for the suggestion. I added that to the README file.