mana auto replay: load both c and cpp plugins
This commit is contained in:
parent
47b8977807
commit
eedd95bd2f
1 changed files with 23 additions and 3 deletions
|
@ -413,8 +413,9 @@ int main(int argc, char *argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<mana::IManaSink> destSink;
|
|
||||||
boost::dll::shared_library pluginHandle;
|
boost::dll::shared_library pluginHandle;
|
||||||
|
std::unique_ptr<mana::IManaPlugin> manaCppPlugin;
|
||||||
|
std::unique_ptr<mana::IManaSink> destSink;
|
||||||
|
|
||||||
if (parser("--plugin"))
|
if (parser("--plugin"))
|
||||||
{
|
{
|
||||||
|
@ -422,8 +423,27 @@ int main(int argc, char *argv[])
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pluginHandle = boost::dll::shared_library(pluginFile);
|
pluginHandle = boost::dll::shared_library(pluginFile);
|
||||||
destSink = std::make_unique<mana::ManaCSink>(
|
|
||||||
pluginHandle.get<mana_sink_plugin_t()>("mana_get_sink_plugin")());
|
try
|
||||||
|
{
|
||||||
|
destSink = std::make_unique<mana::ManaCSink>(
|
||||||
|
pluginHandle.get<mana_sink_plugin_t()>("mana_get_sink_plugin")());
|
||||||
|
}
|
||||||
|
catch (const std::exception &e)
|
||||||
|
{
|
||||||
|
spdlog::debug("plugin {} is not a MANA_C_SINK_PLUGIN", pluginFile);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
manaCppPlugin = std::unique_ptr<mana::IManaPlugin>(
|
||||||
|
pluginHandle.get<mana::IManaPlugin *()>("mana_get_plugin")());
|
||||||
|
destSink = manaCppPlugin->makeSink();
|
||||||
|
}
|
||||||
|
catch (const std::exception &e)
|
||||||
|
{
|
||||||
|
std::cerr << fmt::format("Error loading plugin: {}\n", e.what());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (const std::exception &e)
|
catch (const std::exception &e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue