diff --git a/SCsub b/SCsub index 062cf2b..893699a 100644 --- a/SCsub +++ b/SCsub @@ -4,7 +4,7 @@ import os Import("env") # Define the context constant for module build -env.Append(CPPDEFINES=["GODOT_MODULE_BUILD"]) +env.Append(CPPDEFINES=["REDOT_MODULE_BUILD"]) # Sources to include in the module module_sources = Glob("*.cpp") diff --git a/register_types.cpp b/register_types.cpp index c6652d8..96de196 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -7,6 +7,14 @@ using namespace godot; +#endif + +#ifdef REDOT_MODULE_BUILD + +#include "core/objects/class_db.h" + +#endif + void initialize_module(ModuleInitializationLevel p_level) { if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { return; @@ -21,6 +29,8 @@ void uninitialize_module(ModuleInitializationLevel p_level) { } } +#ifdef GD_EXTENSION_BUILD + extern "C" { // Initialization. GDExtensionBool GDE_EXPORT extension_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) { @@ -34,13 +44,4 @@ GDExtensionBool GDE_EXPORT extension_init(GDExtensionInterfaceGetProcAddress p_g } } -#elif defined(GODOT_MODULE_BUILD) -#include "register_types.h" - -void register_types() { - // Register classes here -} - -void unregister_types() { -} -#endif +#endif \ No newline at end of file diff --git a/register_types.h b/register_types.h index a8e62cf..977960a 100644 --- a/register_types.h +++ b/register_types.h @@ -4,7 +4,10 @@ #ifdef GD_EXTENSION_BUILD #include using namespace godot; -#elif defined(GODOT_MODULE_BUILD) +#endif + + +#ifdef REDOT_MODULE_BUILD #include "core/object/class_db.h" #endif