1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-02 19:01:36 +00:00

[HTML5] Add GDNative+Threads build.

This commit is contained in:
Fabio Alessandrelli
2021-05-24 18:12:26 +02:00
parent e9ca65207e
commit 65dc01bd8e
4 changed files with 21 additions and 22 deletions

View File

@@ -271,19 +271,16 @@ class EditorExportPlatformJavaScript : public EditorExportPlatform {
EXPORT_MODE_NORMAL = 0,
EXPORT_MODE_THREADS = 1,
EXPORT_MODE_GDNATIVE = 2,
EXPORT_MODE_THREADS_GDNATIVE = 3,
};
String _get_template_name(ExportMode p_mode, bool p_debug) const {
String name = "webassembly";
switch (p_mode) {
case EXPORT_MODE_THREADS:
name += "_threads";
break;
case EXPORT_MODE_GDNATIVE:
name += "_gdnative";
break;
default:
break;
if (p_mode & EXPORT_MODE_GDNATIVE) {
name += "_gdnative";
}
if (p_mode & EXPORT_MODE_THREADS) {
name += "_threads";
}
if (p_debug) {
name += "_debug.zip";
@@ -540,7 +537,7 @@ Error EditorExportPlatformJavaScript::_build_pwa(const Ref<EditorExportPreset> &
cache_files.push_back(name + ".icon.png");
cache_files.push_back(name + ".apple-touch-icon.png");
}
if (mode == EXPORT_MODE_THREADS) {
if (mode & EXPORT_MODE_THREADS) {
cache_files.push_back(name + ".worker.js");
cache_files.push_back(name + ".audio.worklet.js");
}
@@ -550,7 +547,7 @@ Error EditorExportPlatformJavaScript::_build_pwa(const Ref<EditorExportPreset> &
Array opt_cache_files;
opt_cache_files.push_back(name + ".wasm");
opt_cache_files.push_back(name + ".pck");
if (mode == EXPORT_MODE_GDNATIVE) {
if (mode & EXPORT_MODE_GDNATIVE) {
opt_cache_files.push_back(name + ".side.wasm");
for (int i = 0; i < p_shared_objects.size(); i++) {
opt_cache_files.push_back(p_shared_objects[i].path.get_file());
@@ -646,9 +643,10 @@ void EditorExportPlatformJavaScript::get_preset_features(const Ref<EditorExportP
}
}
ExportMode mode = (ExportMode)(int)p_preset->get("variant/export_type");
if (mode == EXPORT_MODE_THREADS) {
if (mode & EXPORT_MODE_THREADS) {
r_features->push_back("threads");
} else if (mode == EXPORT_MODE_GDNATIVE) {
}
if (mode & EXPORT_MODE_GDNATIVE) {
r_features->push_back("wasm32");
}
}