mirror of
https://github.com/Lurkki14/tuxclocker.git
synced 2025-02-25 18:55:24 -06:00
daemon: optionally use plugin path from environment
This commit is contained in:
parent
ec368cd76e
commit
3922d4d419
@ -11,8 +11,17 @@ std::string Plugin::pluginPath() { return TC_PLUGIN_PATH; }
|
|||||||
|
|
||||||
std::optional<std::vector<boost::shared_ptr<DevicePlugin>>> DevicePlugin::loadPlugins() {
|
std::optional<std::vector<boost::shared_ptr<DevicePlugin>>> DevicePlugin::loadPlugins() {
|
||||||
std::vector<boost::shared_ptr<DevicePlugin>> retval;
|
std::vector<boost::shared_ptr<DevicePlugin>> retval;
|
||||||
// std::cout << pluginPath();
|
|
||||||
for (const fs::directory_entry &entry : fs::directory_iterator(Plugin::pluginPath())) {
|
std::string pluginPath;
|
||||||
|
const char *pluginPathEnv = std::getenv("TUXCLOCKER_PLUGIN_PATH");
|
||||||
|
|
||||||
|
// Use plugin path from environment if it exists
|
||||||
|
if (pluginPathEnv)
|
||||||
|
pluginPath = pluginPathEnv;
|
||||||
|
else
|
||||||
|
pluginPath = Plugin::pluginPath();
|
||||||
|
|
||||||
|
for (const fs::directory_entry &entry : fs::directory_iterator(pluginPath)) {
|
||||||
// Bleh, have to catch this unless I do more manual checks
|
// Bleh, have to catch this unless I do more manual checks
|
||||||
try {
|
try {
|
||||||
auto plugin = boost::dll::import_symbol<DevicePlugin>(
|
auto plugin = boost::dll::import_symbol<DevicePlugin>(
|
||||||
|
Loading…
Reference in New Issue
Block a user