Skip to content

Commit 194d437

Browse files
committed
Remove feature 'bindings'
The main use case was to support custom versions of Godot through a convoluted build process. With the new feature 'custom-godot', the user can directly generate bindings from a Godot version of choice. However, godot-rust is not designed to be used without the GDNative API, so there is not much point in keeping that feature.
1 parent 0e8e118 commit 194d437

File tree

3 files changed

+35
-24
lines changed

3 files changed

+35
-24
lines changed

gdnative/Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ edition = "2018"
1313

1414
[features]
1515
# Public
16-
async = ["gdnative-async", "bindings"]
17-
bindings = ["gdnative-bindings"]
16+
async = ["gdnative-async"]
1817
custom-godot = ["gdnative-bindings/custom-godot"]
19-
default = ["bindings"]
18+
default = []
2019
formatted = ["gdnative-bindings/formatted", "gdnative-bindings/one_class_one_file"]
2120
serde = ["gdnative-core/serde"]
2221

@@ -27,7 +26,7 @@ type_tag_fallback = ["gdnative-core/type_tag_fallback"]
2726
[dependencies]
2827
gdnative-derive = { path = "../gdnative-derive", version = "=0.9.3" }
2928
gdnative-core = { path = "../gdnative-core", version = "=0.9.3" }
30-
gdnative-bindings = { optional = true, path = "../gdnative-bindings", version = "=0.9.3" }
29+
gdnative-bindings = { path = "../gdnative-bindings", version = "=0.9.3" }
3130
gdnative-async = { optional = true, path = "../gdnative-async", version = "=0.9.3" }
3231

3332
[dev-dependencies]

gdnative/src/lib.rs

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
//!
2323
//! The `api` module contains high-level wrappers for all the API types generated from a
2424
//! JSON description of the API. The generated types are tied to a specific version, which
25-
//! is currently `3.2.3-stable` for the crates.io version. If you want to use the bindings
26-
//! with another version of the engine, see the instructions [here][custom-version] on
27-
//! generating custom bindings.
25+
//! is currently `3.2.3-stable` for the crates.io version. If you want to use the bindings with
26+
//! another version of the engine, read the notes on the `custom-godot` feature flag below.
2827
//!
2928
//! ### Memory management
3029
//!
@@ -40,21 +39,38 @@
4039
//! on `Ref`.
4140
//!
4241
//! ## Feature flags
43-
//! Functionality toggles:
44-
//! * `async` -- *disabled* by default. Enables asyn functionality, see [`tasks`] module for details.
45-
//! * `serde` -- *disabled* by default. Enable for `serde` support. See also
46-
//! [`Variant`](core_types::Variant).
47-
//!
48-
//! Affecting bindings generation:
49-
//! * `bindings` -- *enabled* by default. Includes the crates.io version of the bindings in the
50-
//! `api` module. Disable if you want to use a custom Godot version.
51-
//! * `custom-godot` -- *disabled* by default. When active, looks for a `GODOT_BIN` environment
52-
//! variable pointing to the Godot executable, or a `godot` executable in the path.
53-
//! * `formatted` -- *disabled* by default. Enable if the generated binding source code should
54-
//! be human-readable.
42+
//! All features are disabled by default.
43+
//!
44+
//! Functionality toggles:
45+
//!
46+
//! * **`async`**<br>
47+
//! Activates async functionality, see [`tasks`] module for details.
48+
//!
49+
//! * **`serde`**<br>
50+
//! Enable for `serde` support of several core types. See also [`Variant`](core_types::Variant).
51+
//!
52+
//! Bindings generation:
53+
//!
54+
//! * **`custom-godot`**<br>
55+
//! When active, tries to locate a Godot executable on your system, in this order:
56+
//! 1. If a `GODOT_BIN` environment variable is defined, it will interpret it as a path to the binary
57+
//! (not directory).
58+
//! 2. An executable called `godot`, accessible in your system's PATH, is used.
59+
//! 3. If neither of the above is found, an error is generated.
60+
//!
61+
//! The symbols in [`api`] will be generated in a way compatible with that engine version.
62+
//! This allows to use Godot versions older than the currently supported ones. Note that there
63+
//! are some bugs for Godot versions prior to 3.3.1.
64+
//!
65+
//! See [Custom Godot builds][custom-godot] for detailed instructions.
66+
//!
67+
//! * **`formatted`**<br>
68+
//! Enable if the generated binding source code should be human-readable and split
69+
//! into multiple files. This can also help IDEs that struggle with a single huge file.
5570
//!
5671
//! [thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html
57-
//! [custom-version]: https://github.com/godot-rust/godot-rust/#other-versions-or-custom-builds
72+
//! [custom-godot]: https://godot-rust.github.io/book/advanced-guides/custom-godot.html
73+
//!
5874
//!
5975
6076
// TODO: add logo using #![doc(html_logo_url = "https://<url>")]
@@ -79,10 +95,8 @@ pub mod prelude;
7995

8096
/// Bindings for the Godot Class API.
8197
#[doc(inline)]
82-
#[cfg(feature = "bindings")]
8398
pub use gdnative_bindings as api;
8499

85-
/// Support for async code
86100
#[doc(inline)]
87101
#[cfg(feature = "async")]
88102
pub use gdnative_async as tasks;

gdnative/src/prelude.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#[cfg(feature = "bindings")]
21
pub use gdnative_bindings::utils::*;
3-
#[cfg(feature = "bindings")]
42
pub use gdnative_bindings::{
53
Button, CanvasItem, CanvasLayer, ColorRect, Control, Image, Input, InputEvent, InputEventKey,
64
KinematicBody, KinematicBody2D, Label, Node, Node2D, Object, PackedScene, Reference,

0 commit comments

Comments
 (0)