Skip to content

Commit

Permalink
Merge pull request #120 from Fixstars-momoko/feature/msvc-load-dynami…
Browse files Browse the repository at this point in the history
…c-module

successfully loaded dynamic modules on msvc build aravis
  • Loading branch information
iitaku authored Jun 4, 2022
2 parents 2dd7d6f + a7d22e4 commit 2dcd38b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions include/ion-bb-image-io/rt_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ class DynamicModule {
#ifdef _WIN32
auto file_name = module_name + ".dll";
handle_ = LoadLibraryA(file_name.c_str());

if (handle_ != nullptr){
//successfully loaded the module without the prefix of "lib".
return;
}

file_name = "lib" + file_name;
handle_ = LoadLibraryA(file_name.c_str());

#else
auto file_name = "lib" + module_name + ".so";
handle_ = dlopen(file_name.c_str(), RTLD_NOW);
Expand Down
4 changes: 2 additions & 2 deletions include/ion-bb-image-io/rt_u3v.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <HalideBuffer.h>

#ifdef _WIN32
#define GOBJECT_FILE "libgobject-2.0-0"
#define ARAVIS_FILE "libaravis-0.8-0"
#define GOBJECT_FILE "gobject-2.0-0"
#define ARAVIS_FILE "aravis-0.8-0"
#else
#define GOBJECT_FILE "object-2.0"
#define ARAVIS_FILE "aravis-0.8"
Expand Down

0 comments on commit 2dcd38b

Please sign in to comment.