From 994dfabfd77e30a349a3920c6f82f9c8540e5d6c Mon Sep 17 00:00:00 2001 From: Benjamin Halsted Date: Fri, 26 Jun 2020 09:29:33 -0700 Subject: [PATCH] #396: panic for api v1.3 (Godot 4) --- gdnative-sys/build.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gdnative-sys/build.rs b/gdnative-sys/build.rs index 07117b957..eba334dcb 100644 --- a/gdnative-sys/build.rs +++ b/gdnative-sys/build.rs @@ -455,6 +455,14 @@ mod api_wrapper { eprintln!("{}", &api_json_file); let api_root: ApiRoot = miniserde::json::from_str(&api_json_file) .unwrap_or_else(|_| panic!("Could not parse ({:?}) into ApiRoot", from_json)); + + for api in api_root.all_apis() { + // Currently don't support Godot 4.0 + if api.version.major == 1 && api.version.minor == 3 { + panic!("GodotEngine v4.* is not yet supported. See https://github.com/godot-rust/godot-rust/issues/396"); + } + } + let struct_fields = godot_api_functions(&api_root); let impl_constructor = api_constructor(&api_root); let wrapper = quote! {