aboutsummaryrefslogtreecommitdiff
path: root/lib/pluginloader/test/pluginloader-load.cpp
blob: 9c329a386cc81e75162f935cd44ddcce11a8fb0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "pluginloader.h"
#include <spdlog/spdlog.h>

int main(int argc, char **argv)
{
    if(argc != 2) {
        spdlog::error("usage: {} path/to/plugin.so", argv[0]);
        return -1;
    }

    const auto state = PluginLoader::signature_state(false, true, false);
    PluginLoader loader(argv[1], state);
    if(loader.load()) {
        spdlog::info("Loaded plugin {}", argv[1]);
    } else {
        spdlog::error("Failed loading plugin {}", argv[1]);
        spdlog::error(qUtf8Printable(loader.errorString()));
        return -1;
    }

    return 0;
}