Skip to content

Commit 7706d0b

Browse files
authored
Merge pull request #1338 from godot-rust/bugfix/codegen-targets
Codegen excludes classes only on certain targets
2 parents 8cc51a0 + f2bb63f commit 7706d0b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/workflows/full-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ env:
2626
# * report_objects: list individual leaked objects when running LeakSanitizer
2727
LSAN_OPTIONS: report_objects=1
2828

29-
CARGO_DENY_VERSION: "0.16.1"
30-
CARGO_MACHETE_VERSION: "0.7.0"
29+
CARGO_DENY_VERSION: "0.18.5"
30+
CARGO_MACHETE_VERSION: "0.9.1"
3131

3232

3333
defaults:

godot-codegen/src/special_cases/special_cases.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ pub fn is_native_struct_excluded(ty: &str) -> bool {
9797
codegen_special_cases::is_native_struct_excluded(ty)
9898
}
9999

100+
#[rustfmt::skip]
100101
pub fn is_godot_type_deleted(godot_ty: &str) -> bool {
101102
// Note: parameter can be a class or builtin name, but also something like "enum::AESContext.Mode".
102103

@@ -117,15 +118,20 @@ pub fn is_godot_type_deleted(godot_ty: &str) -> bool {
117118
}
118119
}
119120

121+
// cfg!(target_os = "...") are relatively new and need more testing. If causing problems, revert to `true` (deleted) for now.
122+
// TODO(v0.5): for doc generation, consider moving the target-filters to the generated code, so that API docs still show the classes.
120123
match godot_ty {
121-
// Hardcoded cases that are not accessible.
122124
// Only on Android.
125+
| "JavaClass"
123126
| "JavaClassWrapper"
127+
| "JavaObject"
124128
| "JNISingleton"
125-
| "JavaClass"
129+
=> !cfg!(target_os = "android"),
130+
126131
// Only on Wasm.
127132
| "JavaScriptBridge"
128133
| "JavaScriptObject"
134+
=> !cfg!(target_os = "emscripten"),
129135

130136
// Thread APIs.
131137
| "Thread"

0 commit comments

Comments
 (0)