Skip to content

Commit

Permalink
fix directory not found issue
Browse files Browse the repository at this point in the history
Signed-off-by: Melody Ren <[email protected]>
  • Loading branch information
melody-ren committed Jan 8, 2025
1 parent 8d529e8 commit 56127d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libs/qec/lib/plugin_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ static std::map<std::string, PluginHandle> &get_plugin_handles() {

// Function to load plugins from a directory based on their type
void load_plugins(const std::string &plugin_dir, PluginType type) {
if (!fs::exists(plugin_dir)) {
std::cerr << "WARNING: Plugin directory does not exist: " << plugin_dir
<< std::endl;
return;
}
for (const auto &entry : fs::directory_iterator(plugin_dir)) {
if (entry.path().extension() == ".so") {
void *raw_handle = dlopen(entry.path().c_str(), RTLD_NOW);
Expand Down

0 comments on commit 56127d2

Please sign in to comment.