diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 096b39a..664d317 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -122,5 +122,5 @@ runs: env: SCONS_CACHE: ${{ github.workspace }}/${{ inputs.gdextension_folder }}${{ inputs.scons-cache }} run: | - scons target=${{ inputs.build-target-type }} platform=${{ inputs.platform }} arch=${{ inputs.arch }} precision=${{ inputs.float-precision }} production=yes + scons target=${{ inputs.build-target-type }} platform=${{ inputs.platform }} arch=${{ inputs.arch }} precision=${{ inputs.float-precision }} working-directory: ${{ inputs.gdextension_folder }} diff --git a/.gitignore b/.gitignore index da0f870..de83b56 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,9 @@ custom.py # Ignore generated compile_commands.json compile_commands.json +# Ignore files generated for documentation +/src/gen + # Binaries *.o *.os diff --git a/README.md b/README.md index 01de45a..673595a 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ For getting started after cloning your own copy to your local machine, you shoul * change the pathnames of the to be loaded library name inside the `demo/bin/example.gdextension` file. By replacing `libgdexample` to the name specified in your `SConstruct` file. * change the name of the `demo/bin/example.gdextension` file * change the `entry_symbol` string inside your `demo/bin/your-extension.gdextension` file to be configured for your GDExtension name. This should be the same as the `GDExtensionBool GDE_EXPORT` external C function. As the name suggests, this sets the entry function for your GDExtension to be loaded by the Godot editors C API. -* register the classes you want Godot to interact with inside the `register_types.cpp` file in the initialization method (here `initialize_gdextension_types`) in the syntax `ClassDB::register_class();`. +* register the classes you want Godot to interact with inside the `register_types.cpp` file in the initialization method (here `initialize_gdextension_types`) in the syntax `GDREGISTER_CLASS(CLASS-NAME);`. ## Usage - Actions diff --git a/SConstruct b/SConstruct index 227e1d6..05dafd0 100644 --- a/SConstruct +++ b/SConstruct @@ -77,18 +77,19 @@ if env["target"] in ["editor", "template_debug"]: print("Not including class reference as we're targeting a pre-4.3 baseline.") file = "{}{}{}".format(libname, env["suffix"], env["SHLIBSUFFIX"]) +filepath = "" if env["platform"] == "macos" or env["platform"] == "ios": - platlibname = "{}.{}.{}".format(libname, env["platform"], env["target"]) - file = "{}.framework/{}".format(env["platform"], platlibname, platlibname) + filepath = "{}.framework/".format(env["platform"]) + file = "{}.{}.{}".format(libname, env["platform"], env["target"]) -libraryfile = "bin/{}/{}".format(env["platform"], file) +libraryfile = "bin/{}/{}{}".format(env["platform"], filepath, file) library = env.SharedLibrary( libraryfile, source=sources, ) -copy = env.InstallAs("{}/bin/{}/lib{}".format(projectdir, env["platform"], file), library) +copy = env.InstallAs("{}/bin/{}/{}lib{}".format(projectdir, env["platform"], filepath, file), library) default_args = [library, copy] if localEnv.get("compiledb", False): diff --git a/demo/bin/example.gdextension b/demo/bin/example.gdextension index 679baf6..f3b7df0 100644 --- a/demo/bin/example.gdextension +++ b/demo/bin/example.gdextension @@ -5,21 +5,21 @@ compatibility_minimum = "4.1" [libraries] -macos.debug = "res://bin/libgdexample.macos.template_debug.framework" -macos.release = "res://bin/libgdexample.macos.template_release.framework" -ios.debug = "res://bin/libgdexample.ios.template_debug.framework" -ios.release = "res://bin/libgdexample.ios.template_release.framework" -windows.debug.x86_32 = "res://bin/libgdexample.windows.template_debug.x86_32.dll" -windows.release.x86_32 = "res://bin/libgdexample.windows.template_release.x86_32.dll" -windows.debug.x86_64 = "res://bin/libgdexample.windows.template_debug.x86_64.dll" -windows.release.x86_64 = "res://bin/libgdexample.windows.template_release.x86_64.dll" -linux.debug.x86_64 = "res://bin/libgdexample.linux.template_debug.x86_64.so" -linux.release.x86_64 = "res://bin/libgdexample.linux.template_release.x86_64.so" -linux.debug.arm64 = "res://bin/libgdexample.linux.template_debug.arm64.so" -linux.release.arm64 = "res://bin/libgdexample.linux.template_release.arm64.so" -linux.debug.rv64 = "res://bin/libgdexample.linux.template_debug.rv64.so" -linux.release.rv64 = "res://bin/libgdexample.linux.template_release.rv64.so" -android.debug.x86_64 = "res://bin/libgdexample.android.template_debug.x86_64.so" -android.release.x86_64 = "res://bin/libgdexample.android.template_release.x86_64.so" -android.debug.arm64 = "res://bin/libgdexample.android.template_debug.arm64.so" -android.release.arm64 = "res://bin/libgdexample.android.template_release.arm64.so" +macos.debug = "res://bin/macos/macos.framework/libEXTENSION-NAME.macos.template_debug" +macos.release = "res://bin/macos/macos.framework/libEXTENSION-NAME.macos.template_release" +ios.debug = "res://bin/ios/ios.framework/libEXTENSION-NAME.ios.template_debug" +ios.release = "res://bin/ios/ios.framework/libEXTENSION-NAME.ios.template_release" +windows.debug.x86_32 = "res://bin/windows/libEXTENSION-NAME.windows.template_debug.x86_32.dll" +windows.release.x86_32 = "res://bin/windows/libEXTENSION-NAME.windows.template_release.x86_32.dll" +windows.debug.x86_64 = "res://bin/windows/libEXTENSION-NAME.windows.template_debug.x86_64.dll" +windows.release.x86_64 = "res://bin/windows/libEXTENSION-NAME.windows.template_release.x86_64.dll" +linux.debug.x86_64 = "res://bin/linux/libEXTENSION-NAME.linux.template_debug.x86_64.so" +linux.release.x86_64 = "res://bin/linux/libEXTENSION-NAME.linux.template_release.x86_64.so" +linux.debug.arm64 = "res://bin/linux/libEXTENSION-NAME.linux.template_debug.arm64.so" +linux.release.arm64 = "res://bin/linux/libEXTENSION-NAME.linux.template_release.arm64.so" +linux.debug.rv64 = "res://bin/linux/libEXTENSION-NAME.linux.template_debug.rv64.so" +linux.release.rv64 = "res://bin/linux/libEXTENSION-NAME.linux.template_release.rv64.so" +android.debug.x86_64 = "res://bin/android/libEXTENSION-NAME.android.template_debug.x86_64.so" +android.release.x86_64 = "res://bin/android/libEXTENSION-NAME.android.template_release.x86_64.so" +android.debug.arm64 = "res://bin/android/libEXTENSION-NAME.android.template_debug.arm64.so" +android.release.arm64 = "res://bin/android/libEXTENSION-NAME.android.template_release.arm64.so" diff --git a/src/register_types.cpp b/src/register_types.cpp index 2c86044..9f43623 100644 --- a/src/register_types.cpp +++ b/src/register_types.cpp @@ -11,7 +11,7 @@ void initialize_gdextension_types(ModuleInitializationLevel p_level) if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { return; } - //ClassDB::register_class(); + //GDREGISTER_CLASS(YourClass); } void uninitialize_gdextension_types(ModuleInitializationLevel p_level) {