Skip to content

Commit 60db26d

Browse files
committed
only attempt to load libs for the current os
1 parent ec43cc4 commit 60db26d

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

library/modules/DFSDL.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,24 @@ using std::vector;
2222
static DFLibrary *g_sdl_handle = nullptr;
2323
static DFLibrary *g_sdl_image_handle = nullptr;
2424
static const vector<string> SDL_LIBS {
25-
"SDL2.dll",
25+
#ifdef WIN32
26+
"SDL2.dll"
27+
#elif defined(_DARWIN)
2628
"SDL.framework/Versions/A/SDL",
27-
"SDL.framework/SDL",
29+
"SDL.framework/SDL"
30+
#else
2831
"libSDL2-2.0.so.0"
32+
#endif
2933
};
3034
static const vector<string> SDL_IMAGE_LIBS {
31-
"SDL2_image.dll",
35+
#ifdef WIN32
36+
"SDL2_image.dll"
37+
#elif defined(_DARWIN)
3238
"SDL_image.framework/Versions/A/SDL_image",
33-
"SDL_image.framework/SDL_image",
39+
"SDL_image.framework/SDL_image"
40+
#else
3441
"libSDL2_image-2.0.so.0"
42+
#endif
3543
};
3644

3745
SDL_Surface * (*g_IMG_Load)(const char *) = nullptr;

library/modules/DFSteam.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ static const int DFHACK_STEAM_APPID = 2346660;
1919
static bool g_steam_initialized = false;
2020
static DFLibrary* g_steam_handle = nullptr;
2121
static const std::vector<std::string> STEAM_LIBS {
22-
"steam_api64.dll",
23-
"libsteam_api.so",
22+
#ifdef WIN32
23+
"steam_api64.dll"
24+
#elif defined(_DARWIN)
2425
"steam_api" // TODO: validate this on OSX
26+
#else
27+
"libsteam_api.so"
28+
#endif
2529
};
2630

2731
bool (*g_SteamAPI_Init)() = nullptr;

0 commit comments

Comments
 (0)