Skip to content
Michael Angelo Calimlim edited this page Nov 6, 2023 · 24 revisions

godot-rust-template

Create games with Godot game engine using the Rust programming language!

General Information

  • this template bootstraps your Godot project using Rust as your primary language for development.

Setup

Usage

  • run this commands on your terminal
$ cargo generate --git https://github.com/macalimlim/godot-rust-template --tag v1.1.0 --name my-awesome-game
$ cd my-awesome-game
$ cargo make run
  • enjoy! :godmode:

Please take note that it also generates a export_presets.cfg file for you, you might want to put that on .gitignore if you are planning to put confidential data in it...

Building and Exporting

These commands allows you to build the library and export it to a game.

for Linux

$ cargo make build-i686-unknown-linux-gnu-debug
$ cargo make export-i686-unknown-linux-gnu-debug

$ cargo make build-i686-unknown-linux-gnu-release
$ cargo make export-i686-unknown-linux-gnu-release

$ cargo make build-x86_64-unknown-linux-gnu-debug
$ cargo make export-x86_64-unknown-linux-gnu-debug

$ cargo make build-x86_64-unknown-linux-gnu-release
$ cargo make export-x86_64-unknown-linux-gnu-release

for Android

To be able to deploy the game to your phone or publish it to Google Play, keystore files must be created first.

$ cargo make create-debug-keystore
$ cargo make create-release-keystore <password>

$ cargo make build-aarch64-linux-android-debug
$ cargo make export-aarch64-linux-android-debug

$ cargo make build-aarch64-linux-android-release
$ cargo make export-aarch64-linux-android-release

$ cargo make build-armv7-linux-androideabi-debug
$ cargo make export-armv7-linux-androideabi-debug

$ cargo make build-armv7-linux-androideabi-release
$ cargo make export-armv7-linux-androideabi-release

$ cargo make build-i686-linux-android-debug
$ cargo make export-i686-linux-android-debug

$ cargo make build-i686-linux-android-release
$ cargo make export-i686-linux-android-release

$ cargo make build-x86_64-linux-android-debug
$ cargo make export-x86_64-linux-android-debug

$ cargo make build-x86_64-linux-android-release
$ cargo make export-x86_64-linux-android-release

for MacOS

$ cargo make build-x86_64-apple-darwin-debug
$ cargo make export-x86_64-apple-darwin-debug

$ cargo make build-x86_64-apple-darwin-release
$ cargo make export-x86_64-apple-darwin-release

for iOS

$ cargo make build-aarch64-apple-ios-debug
$ cargo make export-aarch64-apple-ios-debug

$ cargo make build-aarch64-apple-ios-release
$ cargo make export-aarch64-apple-ios-release

for Windows

> cargo make switch-gdnlib-msvc-to-gnu-entry

> cargo make build-i686-pc-windows-gnu-debug
> cargo make export-i686-pc-windows-gnu-debug

> cargo make build-i686-pc-windows-gnu-release
> cargo make export-i686-pc-windows-gnu-release

> cargo make build-x86_64-pc-windows-gnu-debug
> cargo make export-x86_64-pc-windows-gnu-debug

> cargo make build-x86_64-pc-windows-gnu-release
> cargo make export-x86_64-pc-windows-gnu-release

> cargo make switch-gdnlib-gnu-to-msvc-entry

> cargo make build-i686-pc-windows-msvc-debug
> cargo make export-i686-pc-windows-msvc-debug

> cargo make build-i686-pc-windows-msvc-release
> cargo make export-i686-pc-windows-msvc-release

> cargo make build-x86_64-pc-windows-msvc-debug
> cargo make export-x86_64-pc-windows-msvc-debug

> cargo make build-x86_64-pc-windows-msvc-release
> cargo make export-x86_64-pc-windows-msvc-release

Please take note that in the run target of the Makefile, remove the make command of the windows toolchain that you will not use (either msvc or gnu) and then in the godot/native/game.gdnlib file, comment/uncomment the Windows entry accordingly.

Contributing

PRs are welcome! 😄, please see the contribution guidelines

License

MIT License