simplify library name

main
Nathan Franke 4 years ago
parent 02de0c88ee
commit fbfbb11c25
No known key found for this signature in database
GPG Key ID: 082B90CF10A5B648

@ -9,14 +9,14 @@ sources = Glob("src/*.cpp")
if env["platform"] == "osx": if env["platform"] == "osx":
library = env.SharedLibrary( library = env.SharedLibrary(
"addons/example/bin/libgdexample.{}.{}.framework/libgdexample.{}.{}".format( "addons/example/bin/libgdextension.{}.{}.framework/libgdextension.{}.{}".format(
env["platform"], env["target"], env["platform"], env["target"] env["platform"], env["target"], env["platform"], env["target"]
), ),
source=sources, source=sources,
) )
else: else:
library = env.SharedLibrary( library = env.SharedLibrary(
"addons/example/bin/libgdexample.{}.{}.{}{}".format( "addons/example/bin/libgdextension.{}.{}.{}{}".format(
env["platform"], env["target"], env["arch_suffix"], env["SHLIBSUFFIX"] env["platform"], env["target"], env["arch_suffix"], env["SHLIBSUFFIX"]
), ),
source=sources, source=sources,

@ -1,16 +1,16 @@
[configuration] [configuration]
entry_symbol = "example_library_init" entry_symbol = "gdextension_init"
[libraries] [libraries]
macos.debug = "bin/libgdexample.osx.debug.framework" macos.debug = "bin/libgdextension.osx.debug.framework"
macos.release = "bin/libgdexample.osx.release.framework" macos.release = "bin/libgdextension.osx.release.framework"
windows.debug.x86_64 = "bin/libgdexample.windows.debug.x86_64.dll" windows.debug.x86_64 = "bin/libgdextension.windows.debug.x86_64.dll"
windows.release.x86_64 = "bin/libgdexample.windows.release.x86_64.dll" windows.release.x86_64 = "bin/libgdextension.windows.release.x86_64.dll"
linux.debug.x86_64 = "bin/libgdexample.linux.debug.x86_64.so" linux.debug.x86_64 = "bin/libgdextension.linux.debug.x86_64.so"
linux.release.x86_64 = "bin/libgdexample.linux.release.x86_64.so" linux.release.x86_64 = "bin/libgdextension.linux.release.x86_64.so"
linux.debug.arm64 = "bin/libgdexample.linux.debug.arm64.so" linux.debug.arm64 = "bin/libgdextension.linux.debug.arm64.so"
linux.release.arm64 = "bin/libgdexample.linux.release.arm64.so" linux.release.arm64 = "bin/libgdextension.linux.release.arm64.so"
linux.debug.rv64 = "bin/libgdexample.linux.debug.rv64.so" linux.debug.rv64 = "bin/libgdextension.linux.debug.rv64.so"
linux.release.rv64 = "bin/libgdexample.linux.release.rv64.so" linux.release.rv64 = "bin/libgdextension.linux.release.rv64.so"

@ -10,32 +10,29 @@
using namespace godot; using namespace godot;
void initialize_example_module(ModuleInitializationLevel p_level) void gdextension_initialize(ModuleInitializationLevel p_level)
{ {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE)
{ {
return;
}
ClassDB::register_class<Example>(); ClassDB::register_class<Example>();
} }
}
void uninitialize_example_module(ModuleInitializationLevel p_level) void gdextension_terminate(ModuleInitializationLevel p_level)
{ {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE)
{ {
return;
} }
} }
extern "C" extern "C"
{ {
GDNativeBool GDN_EXPORT example_library_init(const GDNativeInterface *p_interface, const GDNativeExtensionClassLibraryPtr p_library, GDNativeInitialization *r_initialization) GDNativeBool GDN_EXPORT gdextension_init(const GDNativeInterface *p_interface, const GDNativeExtensionClassLibraryPtr p_library, GDNativeInitialization *r_initialization)
{ {
godot::GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization); godot::GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization);
init_obj.register_initializer(initialize_example_module); init_obj.register_initializer(gdextension_initialize);
init_obj.register_terminator(uninitialize_example_module); init_obj.register_terminator(gdextension_terminate);
init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE); init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE);
return init_obj.init(); return init_obj.init();

@ -3,5 +3,5 @@
#include <godot_cpp/core/class_db.hpp> #include <godot_cpp/core/class_db.hpp>
using namespace godot; using namespace godot;
void initialize_example_module(ModuleInitializationLevel p_level); void gdextension_initialize(ModuleInitializationLevel p_level);
void uninitialize_example_module(ModuleInitializationLevel p_level); void gdextension_terminate(ModuleInitializationLevel p_level);

Loading…
Cancel
Save