Skip to content

Commit

Permalink
Fix issue with #[cfg(..)] in release-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Jan 30, 2025
1 parent e6b7772 commit 8bb4468
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions godot-codegen/src/generator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,22 @@ pub mod virtual_hashes;
// - native_structures

pub fn generate_sys_module_file(sys_gen_path: &Path, submit_fn: &mut SubmitFn) {
// Don't delegate #[cfg] to generated code; causes issues in release CI, reproducible with:
// cargo clippy --features godot/experimental-godot-api,godot/codegen-rustfmt,godot/serde
let virtual_hashes_mod = if cfg!(since_api = "4.4") {
quote! { pub mod virtual_hashes; }
} else {
quote! {}
};

let code = quote! {
pub mod table_builtins;
pub mod table_builtins_lifecycle;
pub mod table_servers_classes;
pub mod table_scene_classes;
pub mod table_editor_classes;
pub mod table_utilities;
#[cfg(since_api = "4.4")]
pub mod virtual_hashes;
#virtual_hashes_mod

pub mod central;
pub mod gdextension_interface;
Expand Down
2 changes: 1 addition & 1 deletion godot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
//!
//! ## Cargo features
//!
//! The following features can be enabled for this crate. All off them are off by default.
//! The following features can be enabled for this crate. All of them are off by default.
//!
//! Avoid `default-features = false` unless you know exactly what you are doing; it will disable some required internal features.
//!
Expand Down

0 comments on commit 8bb4468

Please sign in to comment.