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.
This commit is contained in:
Pedro J. Estébanez 2018-11-16 23:54:45 +01:00
parent 1bbad8c469
commit 57b2b275b4

View file

@ -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);
}
}