Skip to content

Commit

Permalink
[add] search for linux lib variants
Browse files Browse the repository at this point in the history
  • Loading branch information
begla committed Jul 29, 2024
1 parent 4dc24f6 commit 3a404fd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion iolite_plugins/shared/iolite_plugins_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "iolite_api.h"

// Dependencies
#include <string>
#define STB_SPRINTF_IMPLEMENTATION
#include "stb_sprintf.h"

Expand All @@ -52,7 +53,14 @@ void* load_library(const char* name)
#ifdef _WIN32
return LoadLibraryA(name);
#else
return dlopen(name, RTLD_LAZY);
void * handle = dlopen(name, RTLD_LAZY);
if (!handle)
handle = dlopen((std::string("lib") + name).c_str(), RTLD_LAZY);
if (!handle)
handle = dlopen((std::string(name) + ".so").c_str(), RTLD_LAZY);
if (!handle)
handle = dlopen((std::string("lib") + name + ".so").c_str(), RTLD_LAZY);
return handle;
#endif
}

Expand Down

0 comments on commit 3a404fd

Please sign in to comment.