This repository has been archived by the owner on Nov 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env python | ||
from misc.utility.scons_hints import * | ||
|
||
Import("env") | ||
Import("env_modules") | ||
|
||
def get_sufix(): | ||
suffix = ".{}.{}".format(env["platform"], env["target"]) | ||
if env.dev_build: | ||
suffix += ".dev" | ||
if env["precision"] == "double": | ||
suffix += ".double" | ||
suffix += "." + env["arch"] | ||
if not env["threads"]: | ||
suffix += ".nothreads" | ||
return suffix.replace("editor", "template_release") | ||
|
||
# Libraries | ||
if env["platform"] == "macos" or env["platform"] == "ios": | ||
base_path = "#modules/sandbox/bin/addons/godot_sandbox/bin/libgodot_riscv{}.framework".format(get_sufix()) | ||
base_file = "libgodot_riscv{}".format(get_sufix()) | ||
else: | ||
base_path = "#modules/sandbox/bin/addons/godot_sandbox/bin" | ||
base_file = "libgodot_riscv{}".format(get_sufix()) | ||
|
||
env.Append(LIBS=[base_file]) | ||
env.Append(LIBPATH=[base_path]) | ||
|
||
# Godot-cpp | ||
base_path = "#modules/sandbox/ext/godot-cpp/bin" | ||
base_file = "libgodot-cpp{}".format(get_sufix()) | ||
|
||
env.Append(LIBS=[base_file]) | ||
env.Append(LIBPATH=[base_path]) | ||
|
||
# Sources | ||
env_gdextension = env_modules.Clone() | ||
|
||
env_gdextension.add_source_files(env.modules_sources, "*.cpp") |
Binary file added
BIN
+7.84 MB
...ules/sandbox/bin/addons/godot_sandbox/bin/libgodot_riscv.android.template_release.arm32.a
Binary file not shown.
Binary file added
BIN
+9.56 MB
...ules/sandbox/bin/addons/godot_sandbox/bin/libgodot_riscv.android.template_release.arm64.a
Binary file not shown.
Binary file added
BIN
+7.84 MB
...ndbox/bin/addons/godot_sandbox/bin/libgodot_riscv.android.template_release.double.arm32.a
Binary file not shown.
Binary file added
BIN
+9.56 MB
...ndbox/bin/addons/godot_sandbox/bin/libgodot_riscv.android.template_release.double.arm64.a
Binary file not shown.
Binary file added
BIN
+6.66 MB
...dbox/bin/addons/godot_sandbox/bin/libgodot_riscv.android.template_release.double.x86_32.a
Binary file not shown.
Binary file added
BIN
+9.01 MB
...dbox/bin/addons/godot_sandbox/bin/libgodot_riscv.android.template_release.double.x86_64.a
Binary file not shown.
Binary file added
BIN
+6.65 MB
...les/sandbox/bin/addons/godot_sandbox/bin/libgodot_riscv.android.template_release.x86_32.a
Binary file not shown.
Binary file added
BIN
+9 MB
...les/sandbox/bin/addons/godot_sandbox/bin/libgodot_riscv.android.template_release.x86_64.a
Binary file not shown.
Binary file added
BIN
+5.51 MB
...ot_riscv.ios.template_release.arm64.framework/libgodot_riscv.ios.template_release.arm64.a
Binary file not shown.
Binary file added
BIN
+5.51 MB
...emplate_release.double.arm64.framework/libgodot_riscv.ios.template_release.double.arm64.a
Binary file not shown.
Binary file added
BIN
+9.39 MB
...andbox/bin/addons/godot_sandbox/bin/libgodot_riscv.linux.template_release.double.x86_64.a
Binary file not shown.
Binary file added
BIN
+9.38 MB
...dules/sandbox/bin/addons/godot_sandbox/bin/libgodot_riscv.linux.template_release.x86_64.a
Binary file not shown.
Binary file added
BIN
+5.5 MB
...iscv.macos.template_release.arm64.framework/libgodot_riscv.macos.template_release.arm64.a
Binary file not shown.
Binary file added
BIN
+5.5 MB
...plate_release.double.arm64.framework/libgodot_riscv.macos.template_release.double.arm64.a
Binary file not shown.
Binary file added
BIN
+5.46 MB
...ate_release.double.x86_64.framework/libgodot_riscv.macos.template_release.double.x86_64.a
Binary file not shown.
Binary file added
BIN
+5.45 MB
...cv.macos.template_release.x86_64.framework/libgodot_riscv.macos.template_release.x86_64.a
Binary file not shown.
Binary file added
BIN
+4.88 MB
.../sandbox/bin/addons/godot_sandbox/bin/libgodot_riscv.web.template_release.double.wasm32.a
Binary file not shown.
Binary file added
BIN
+4.88 MB
...modules/sandbox/bin/addons/godot_sandbox/bin/libgodot_riscv.web.template_release.wasm32.a
Binary file not shown.
Binary file added
BIN
+9.23 MB
...ules/sandbox/bin/addons/godot_sandbox/bin/libgodot_riscv.windows.template_release.arm64.a
Binary file not shown.
Binary file added
BIN
+9.23 MB
...ndbox/bin/addons/godot_sandbox/bin/libgodot_riscv.windows.template_release.double.arm64.a
Binary file not shown.
Binary file added
BIN
+9.23 MB
...dbox/bin/addons/godot_sandbox/bin/libgodot_riscv.windows.template_release.double.x86_32.a
Binary file not shown.
Binary file added
BIN
+9.23 MB
...dbox/bin/addons/godot_sandbox/bin/libgodot_riscv.windows.template_release.double.x86_64.a
Binary file not shown.
Binary file added
BIN
+9.23 MB
...les/sandbox/bin/addons/godot_sandbox/bin/libgodot_riscv.windows.template_release.x86_32.a
Binary file not shown.
Binary file added
BIN
+9.23 MB
...les/sandbox/bin/addons/godot_sandbox/bin/libgodot_riscv.windows.template_release.x86_64.a
Binary file not shown.
Binary file added
BIN
+1.92 KB
...s/sandbox/bin/addons/godot_sandbox/bin/liblibgodot_riscv.windows.template_release.arm64.a
Binary file not shown.
Binary file added
BIN
+1.99 KB
...ox/bin/addons/godot_sandbox/bin/liblibgodot_riscv.windows.template_release.double.arm64.a
Binary file not shown.
Binary file added
BIN
+2 KB
...x/bin/addons/godot_sandbox/bin/liblibgodot_riscv.windows.template_release.double.x86_32.a
Binary file not shown.
Binary file added
BIN
+2 KB
...x/bin/addons/godot_sandbox/bin/liblibgodot_riscv.windows.template_release.double.x86_64.a
Binary file not shown.
Binary file added
BIN
+1.93 KB
.../sandbox/bin/addons/godot_sandbox/bin/liblibgodot_riscv.windows.template_release.x86_32.a
Binary file not shown.
Binary file added
BIN
+1.93 KB
.../sandbox/bin/addons/godot_sandbox/bin/liblibgodot_riscv.windows.template_release.x86_64.a
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def can_build(env, platform): | ||
return True | ||
|
||
|
||
def configure(env): | ||
pass |
41 changes: 41 additions & 0 deletions
41
godot/modules/sandbox/gdextension_static_library_loader.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "gdextension_static_library_loader.h" | ||
|
||
#include "core/config/project_settings.h" | ||
#include "core/io/dir_access.h" | ||
#include "core/version.h" | ||
#include "core/extension/gdextension.h" | ||
|
||
Error GDExtensionStaticLibraryLoader::open_library(const String &p_path) { | ||
library_path = p_path; | ||
return OK; | ||
} | ||
|
||
Error GDExtensionStaticLibraryLoader::initialize(GDExtensionInterfaceGetProcAddress p_get_proc_address, const Ref<GDExtension> &p_extension, GDExtensionInitialization *r_initialization) { | ||
|
||
GDExtensionInitializationFunction initialization_function = (GDExtensionInitializationFunction)entry_funcptr; | ||
if (initialization_function == nullptr) { | ||
} | ||
GDExtensionBool ret = initialization_function(p_get_proc_address, p_extension.ptr(), r_initialization); | ||
|
||
if (ret) { | ||
return OK; | ||
} else { | ||
ERR_PRINT("GDExtension initialization function '" + library_path + "' returned an error."); | ||
return FAILED; | ||
} | ||
} | ||
|
||
void GDExtensionStaticLibraryLoader::close_library() { | ||
} | ||
|
||
bool GDExtensionStaticLibraryLoader::is_library_open() const { | ||
return true; | ||
} | ||
|
||
bool GDExtensionStaticLibraryLoader::has_library_changed() const { | ||
return false; | ||
} | ||
|
||
bool GDExtensionStaticLibraryLoader::library_exists() const { | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef GDEXTENSION_STATIC_LIBRARY_LOADER_H | ||
#define GDEXTENSION_STATIC_LIBRARY_LOADER_H | ||
|
||
#include <functional> | ||
|
||
#include "core/extension/gdextension_loader.h" | ||
#include "core/io/config_file.h" | ||
#include "core/os/shared_object.h" | ||
|
||
class GDExtensionStaticLibraryLoader : public GDExtensionLoader { | ||
friend class GDExtensionManager; | ||
friend class GDExtension; | ||
|
||
private: | ||
String resource_path; | ||
void *entry_funcptr = nullptr; | ||
String library_path; | ||
Vector<SharedObject> library_dependencies; | ||
|
||
HashMap<String, String> class_icon_paths; | ||
|
||
public: | ||
void set_entry_funcptr(void *p_entry_funcptr) { entry_funcptr = p_entry_funcptr; } | ||
virtual Error open_library(const String &p_path) override; | ||
virtual Error initialize(GDExtensionInterfaceGetProcAddress p_get_proc_address, const Ref<GDExtension> &p_extension, GDExtensionInitialization *r_initialization) override; | ||
virtual void close_library() override; | ||
virtual bool is_library_open() const override; | ||
virtual bool has_library_changed() const override; | ||
virtual bool library_exists() const override; | ||
}; | ||
|
||
#endif // GDEXTENSION_STATIC_LIBRARY_LOADER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "register_types.h" | ||
#include "core/object/object.h" | ||
#include "core/extension/gdextension_interface.h" | ||
#include "core/extension/gdextension_manager.h" | ||
#include "./gdextension_static_library_loader.h" | ||
#include "core/object/ref_counted.h" | ||
|
||
extern "C" { | ||
GDExtensionBool riscv_library_init( | ||
GDExtensionInterfaceGetProcAddress p_get_proc_address, | ||
GDExtensionClassLibraryPtr p_library, | ||
GDExtensionInitialization *r_initialization | ||
); | ||
} | ||
|
||
void initialize_sandbox_module(ModuleInitializationLevel p_level) { | ||
if (p_level != MODULE_INITIALIZATION_LEVEL_SERVERS) { | ||
return; | ||
} | ||
|
||
Ref<GDExtensionStaticLibraryLoader> loader; | ||
loader.instantiate(); | ||
loader->set_entry_funcptr((void*)&riscv_library_init); | ||
GDExtensionManager::get_singleton()->load_extension_with_loader("sandbox", loader); | ||
} | ||
|
||
void uninitialize_sandbox_module(ModuleInitializationLevel p_level) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef SANDBOX_REGISTER_TYPES_H | ||
#define SANDBOX_REGISTER_TYPES_H | ||
|
||
#include "modules/register_module_types.h" | ||
|
||
void initialize_sandbox_module(ModuleInitializationLevel p_level); | ||
void uninitialize_sandbox_module(ModuleInitializationLevel p_level); | ||
|
||
#endif // SANDBOX_REGISTER_TYPES_H |