Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions to use Cargo to set GODOT4_BIN to relative path. #20

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/toolchain/godot-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,30 @@ Note that this requires the `bindgen`, as such you may need to install the LLVM
Consult the [setup page][setup-llvm] for more information.


### Setting `GODOT4_BIN` to a Relative Path
StagnationPoint marked this conversation as resolved.
Show resolved Hide resolved

If you have multiple Godot workspaces on a machine, you may want a workspace-independent method of setting the `GODOT4_BIN` environment variable
so the matching Godot editor binary for that workspace is always used in the build process, without having to set `GODOT4_BIN` differently for each
location.
StagnationPoint marked this conversation as resolved.
Show resolved Hide resolved

You can do this by configuring Cargo to set `GODOT4_BIN` to a relative path for you, in `.cargo/config.toml`.

In the root of your Rust project, create `.cargo/config.toml` with the example content shown below, modifying the editor path as needed to find
your binary. The path you set will be resolved relative to the location of the `.cargo` directory.
StagnationPoint marked this conversation as resolved.
Show resolved Hide resolved

```toml
[env]
GODOT4_BIN = { value = "../godot/bin/godot.linuxbsd.editor.x86_64", relative = true, force = true }
```

(If you want to override `config.toml` by setting `GODOT4_BIN` in your environment, remove `force = true`.)

Test your change by running `cargo build`.

See [The Cargo Book](https://doc.rust-lang.org/cargo/reference/config.html) for more information on customizing your build environment with
`config.toml`.


[Compatibility and stability]: compatibility.md
[compat-guarantees]: compatibility.md#current-guarantees
[setup-llvm]: ../intro/setup.md#llvm
Expand Down
Loading