feat: configured template

main
Sara 2024-01-30 14:47:20 +01:00
parent fe487ab9ac
commit 6725458795
9 changed files with 39 additions and 34 deletions

1
.gitignore vendored
View File

@ -48,3 +48,4 @@ compile_commands.json
# VSCode # VSCode
.vscode/* .vscode/*
!.vscode/extensions.json !.vscode/extensions.json
.cache/

3
.gitmodules vendored
View File

@ -2,3 +2,6 @@
path = godot-cpp path = godot-cpp
url = https://git.saragerretsen.nl/Sara/godot-cpp.git url = https://git.saragerretsen.nl/Sara/godot-cpp.git
branch = 4.0 branch = 4.0
[submodule "godot-cpp-utils"]
path = godot-cpp-utils
url = https://git.saragerretsen.nl/Sara/godot-cpp-utils.git

View File

@ -11,8 +11,8 @@ def validate_parent_dir(key, val, env):
raise UserError("'%s' is not a directory: %s" % (key, os.path.dirname(val))) raise UserError("'%s' is not a directory: %s" % (key, os.path.dirname(val)))
libname = "EXTENSION-NAME" libname = "pvb-practice"
projectdir = "demo" projectdir = "godot"
localEnv = Environment(tools=["default"], PLATFORM="") localEnv = Environment(tools=["default"], PLATFORM="")
@ -50,8 +50,8 @@ env.Alias("compiledb", compilation_db)
env = SConscript("godot-cpp/SConstruct", {"env": env, "customs": customs}) env = SConscript("godot-cpp/SConstruct", {"env": env, "customs": customs})
env.Append(CPPPATH=["src/"]) env.Append(CPPPATH=["src/", "godot-cpp-utils"])
sources = Glob("src/*.cpp") sources = Glob("src/*.cpp") + Glob("godot-cpp-utils/*.cpp")
file = "{}{}{}".format(libname, env["suffix"], env["SHLIBSUFFIX"]) file = "{}{}{}".format(libname, env["suffix"], env["SHLIBSUFFIX"])

1
godot-cpp-utils Submodule

@ -0,0 +1 @@
Subproject commit 0230e4e1098bbf9d4d28bc6ff4174d1c8051d140

View File

@ -1,23 +0,0 @@
[configuration]
entry_symbol = "example_library_init"
compatibility_minimum = "4.1"
[libraries]
macos.debug = "res://bin/libgdexample.macos.template_debug.framework"
macos.release = "res://bin/libgdexample.macos.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"

View File

@ -0,0 +1,23 @@
[configuration]
entry_symbol = "pvb_practice_init"
compatibility_minimum = "4.1"
[libraries]
macos.debug = "res://bin/macos/libpvb-practice.macos.template_debug.framework"
macos.release = "res://bin/macos/libpvb-practice.macos.template_release.framework"
windows.debug.x86_32 = "res://bin/windows/libpvb-practice.windows.template_debug.x86_32.dll"
windows.release.x86_32 = "res://bin/windows/libpvb-practice.windows.template_release.x86_32.dll"
windows.debug.x86_64 = "res://bin/windows/libpvb-practice.windows.template_debug.x86_64.dll"
windows.release.x86_64 = "res://bin/windows/libpvb-practice.windows.template_release.x86_64.dll"
linux.debug.x86_64 = "res://bin/linux/libpvb-practice.linux.template_debug.x86_64.so"
linux.release.x86_64 = "res://bin/linux/libpvb-practice.linux.template_release.x86_64.so"
linux.debug.arm64 = "res://bin/linux/libpvb-practice.linux.template_debug.arm64.so"
linux.release.arm64 = "res://bin/linux/libpvb-practice.linux.template_release.arm64.so"
linux.debug.rv64 = "res://bin/linux/libpvb-practice.linux.template_debug.rv64.so"
linux.release.rv64 = "res://bin/linux/libpvb-practice.linux.template_release.rv64.so"
android.debug.x86_64 = "res://bin/android/libpvb-practice.android.template_debug.x86_64.so"
android.release.x86_64 = "res://bin/android/libpvb-practice.android.template_release.x86_64.so"
android.debug.arm64 = "res://bin/android/libpvb-practice.android.template_debug.arm64.so"
android.release.arm64 = "res://bin/android/libpvb-practice.android.template_release.arm64.so"

View File

@ -11,5 +11,5 @@ config_version=5
[application] [application]
config/name="godot cpp template" config/name="godot cpp template"
config/features=PackedStringArray("4.1", "Forward Plus") config/features=PackedStringArray("4.2", "Forward Plus")
config/icon="res://icon.svg" config/icon="res://icon.svg"

View File

@ -23,7 +23,7 @@ void uninitialize_gdextension_types(ModuleInitializationLevel p_level) {
extern "C" extern "C"
{ {
// Initialization // Initialization
GDExtensionBool GDE_EXPORT example_library_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) GDExtensionBool GDE_EXPORT pvb_practice_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization)
{ {
GDExtensionBinding::InitObject init_obj(p_get_proc_address, p_library, r_initialization); GDExtensionBinding::InitObject init_obj(p_get_proc_address, p_library, r_initialization);
init_obj.register_initializer(initialize_gdextension_types); init_obj.register_initializer(initialize_gdextension_types);

View File

@ -1,7 +1,7 @@
#ifndef EXAMPLE_REGISTER_TYPES_H #ifndef EXAMPLE_REGISTER_TYPES_H
#define EXAMPLE_REGISTER_TYPES_H #define EXAMPLE_REGISTER_TYPES_H
void initialize_gdextension_types(); extern void initialize_gdextension_types();
void uninitialize_gdextension_types(); extern void uninitialize_gdextension_types();
#endif // EXAMPLE_REGISTER_TYPES_H #endif // EXAMPLE_REGISTER_TYPES_H