A command-line utility to assist in compiling Rust code to WASM modules compatible with MSFS 2020 and 2024
You can install the utility by running cargo install --git https://github.com/navigraph/cargo-msfs
Clang 17 must also be installed. Versions greater than 17 do not work with MSFS.
Ensure your Cargo.toml has the following lines:
[profile.release]
lto = true
strip = trueThe tool supports the following commands:
- install – Installs the SDK for a specified MSFS version.
- remove – Removes the SDK for a specified MSFS version.
- update – Updates the SDK for a specified MSFS version.
- build – Builds a crate for a specified MSFS version. (note: this runs
wasm-optautomatically!) - info – Gets information on installed SDKs.
The tool currently supports the following MSFS versions:
msfs2020– Microsoft Flight Simulator 2020msfs2024– Microsoft Flight Simulator 2024
cargo-msfs <COMMAND> [OPTIONS]command(required) – The command to run. Acceptable values:install,remove,update,build,info.msfs_version(optional) – Specifies the MSFS version for commands that require it (install,remove,update,build).-i, --in-folder(optional) – The path to the crate to build. Required only for thebuildcommand.-o, --out-wasm(optional) – The full path (including filename) to output the compiled WASM file. Required only for thebuildcommand.
cargo-msfs install msfs2020cargo-msfs remove msfs2024cargo-msfs update msfs2020cargo-msfs build msfs2024 -i /path/to/crate -o /path/to/output.wasmcargo-msfs infoThis project is licensed under the MIT License.