diff options
author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2018-11-16 23:54:45 +0100 |
---|---|---|
committer | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2019-07-03 21:54:46 +0200 |
commit | 57b2b275b402d28ea903f5e85d2cb7a470e8200a (patch) | |
tree | b0e4e0c25dfeb5ac475141541a19e1ade87ddc7c /modules/gdnative | |
parent | 1bbad8c4690ac988932e3695a54f869ebd4c32a4 (diff) |
Skip export of non-project libraries
That is, any library referred to in GDNative library resources, won't be copied to the export target path unless its path begins with `res://`.
The case use for this is a bit advanced: having a GDN library that will be deployed separately from the project; for instance, to a path in the system (like `/opt/...`).
Currently the GDN library editor doesn't allow to pick dynamic libraries outside the project, but that can be done by editing the `.gdnlib` file manually.
Diffstat (limited to 'modules/gdnative')
-rw-r--r-- | modules/gdnative/register_types.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index 55d44ceec8..6ff6262b56 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -100,6 +100,11 @@ void GDNativeExportPlugin::_export_file(const String &p_path, const String &p_ty } String entry_lib_path = config->get_value("entry", key); + if (!entry_lib_path.begins_with("res://")) { + print_line("Skipping export of out-of-project library " + entry_lib_path); + continue; + } + add_shared_object(entry_lib_path, tags); } } @@ -129,6 +134,10 @@ void GDNativeExportPlugin::_export_file(const String &p_path, const String &p_ty Vector<String> dependency_paths = config->get_value("dependencies", key); for (int i = 0; i < dependency_paths.size(); i++) { + if (!dependency_paths[i].begins_with("res://")) { + print_line("Skipping export of out-of-project library " + dependency_paths[i]); + continue; + } add_shared_object(dependency_paths[i], tags); } } |