From 8a8dbd76b165db2b94c1625873da9e13bf24c2b9 Mon Sep 17 00:00:00 2001 From: George Marques Date: Tue, 12 Jan 2021 14:12:40 -0300 Subject: Add GDNative JSON generator for the builtin API Which can be used by language bindings to generate code statically. This is generated as a different file from the class API because it has different requirements (the builtin types have constructors and don't have signals), so bindings can better make use of each JSON file without extra parsing. This also cleans up a bit the old API generator, mainly initializing structs and renaming "instanciable" to the more correct "instantiable". The argument description in help text was updated to better reflect how it should be used. The argument is mandatory. --- modules/gdnative/nativescript/nativescript.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'modules/gdnative/nativescript/nativescript.cpp') diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index 944f4f052c..19cf1f980b 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -1257,6 +1257,15 @@ void NativeScriptLanguage::init() { } exit(0); } + + E = args.find("--gdnative-generate-json-builtin-api"); + + if (E && E->next()) { + if (generate_c_builtin_api(E->next()->get()) != OK) { + ERR_PRINT("Failed to generate C builtin API\n"); + } + exit(0); + } #endif #ifdef TOOLS_ENABLED -- cgit v1.2.3