Skip to content

Commit

Permalink
为安卓导出添加依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
Daylily-Zeleen committed Apr 13, 2024
1 parent 8a06030 commit 3c8ae73
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def on_complete(target, source, env):
copy_file(eos_sdk_folder + "Bin/libEOSSDK-Mac-Shipping.dylib", plugin_bin_folder + "/macos/libEOSSDK-Mac-Shipping.dylib")

elif platform == "android":
copy_file(eos_sdk_folder + f"Bin/Android/static-stdc++/libs/{eos_android_arch}/libEOSSDK.so", plugin_bin_folder + f"/andorid/{arch}/libEOSSDK.so")
copy_file(eos_sdk_folder + f"Bin/Android/static-stdc++/libs/{eos_android_arch}/libEOSSDK.so", plugin_bin_folder + f"/android/{arch}/libEOSSDK.so")

# 更新.gdextension中的版本信息
f = open(extension_file, "r", encoding="utf8")
Expand Down
19 changes: 19 additions & 0 deletions gd_eos/src/editor/eos_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,25 @@ void EOSExportPlugin::_export_begin(const PackedStringArray &features, bool is_d
add_shared_object(binary_base_dir.path_join("linux").path_join("libEOSSDK-Linux-Shipping.so"), {}, "/");
} else if (features.has("macos")) {
add_shared_object(binary_base_dir.path_join("macos").path_join("libEOSSDK-Mac-Shipping.dylib"), {}, "/");
} else if (features.has("android")) {
String arch;
for (const String &feature : features) {
if (feature == "arm32") {
ERR_CONTINUE_MSG(!arch.is_empty(), "Exporting features have multiple architechture tags!");
arch = feature;
} else if (feature == "arm64") {
ERR_CONTINUE_MSG(!arch.is_empty(), "Exporting features have multiple architechture tags!");
arch = feature;
} else if (feature == "x86_32") {
ERR_CONTINUE_MSG(!arch.is_empty(), "Exporting features have multiple architechture tags!");
arch = feature;
} else if (feature == "x86_64") {
ERR_CONTINUE_MSG(!arch.is_empty(), "Exporting features have multiple architechture tags!");
arch = feature;
}
}
ERR_FAIL_COND_MSG(arch.is_empty(), "EOS Exporting: Unknown architechture, can't add shared object.");
add_shared_object(binary_base_dir.path_join("android").path_join(arch).path_join("libEOSSDK.so"), {}, "/");
}
}

Expand Down

0 comments on commit 3c8ae73

Please sign in to comment.