Fix linking of OpenAL driver under MinGW

This commit is contained in:
kaetemi 2014-06-18 00:28:08 +02:00
parent a21b4f7c94
commit 747e1de97f
5 changed files with 35 additions and 12 deletions

View file

@ -27,7 +27,7 @@ ENDIF(WITH_STATIC OR WIN32)
# For DirectInput (di_event_emitter) # For DirectInput (di_event_emitter)
IF(WIN32) IF(WIN32)
INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(nelmisc ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) TARGET_LINK_LIBRARIES(nelmisc ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY} winmm dbghelp)
ENDIF(WIN32) ENDIF(WIN32)
IF(UNIX) IF(UNIX)

View file

@ -159,8 +159,10 @@ static LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM
// if the dtor call order is not good. // if the dtor call order is not good.
//exit(EXIT_SUCCESS); //exit(EXIT_SUCCESS);
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
#ifndef NL_COMP_MINGW
// disable the Windows popup telling that the application aborted and disable the dr watson report. // disable the Windows popup telling that the application aborted and disable the dr watson report.
_set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
#endif
#endif #endif
// quit without calling atexit or static object dtors. // quit without calling atexit or static object dtors.
abort(); abort();

View file

@ -1,4 +1,6 @@
EXPORTS NLSOUND_createISoundDriverInstance LIBRARY nel_drv_openal_win_r
EXPORTS NLSOUND_interfaceVersion EXPORTS
EXPORTS NLSOUND_outputProfile NLSOUND_createISoundDriverInstance
EXPORTS NLSOUND_getDriverType NLSOUND_interfaceVersion
NLSOUND_outputProfile
NLSOUND_getDriverType

View file

@ -92,7 +92,12 @@ NLMISC_DECL_PURE_LIB(CSoundDriverALNelLibrary)
* Sound driver instance creation * Sound driver instance creation
*/ */
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
#ifdef NL_COMP_MINGW
#ifndef NL_STATIC
extern "C"
{
#endif
#endif
// ****************************************************************** // ******************************************************************
#ifdef NL_STATIC #ifdef NL_STATIC
@ -140,7 +145,11 @@ __declspec(dllexport) ISoundDriver::TDriver NLSOUND_getDriverType()
} }
// ****************************************************************** // ******************************************************************
#ifdef NL_COMP_MINGW
#ifndef NL_STATIC
}
#endif
#endif
#elif defined (NL_OS_UNIX) #elif defined (NL_OS_UNIX)
#ifndef NL_STATIC #ifndef NL_STATIC

View file

@ -153,7 +153,9 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD
switch(driverType) switch(driverType)
{ {
case DriverFMod: case DriverFMod:
#if defined (NL_OS_WINDOWS) #if defined (NL_COMP_MINGW)
dllName = "libnel_drv_fmod_win";
#elif defined (NL_OS_WINDOWS)
dllName = "nel_drv_fmod_win"; dllName = "nel_drv_fmod_win";
#elif defined (NL_OS_UNIX) #elif defined (NL_OS_UNIX)
dllName = "nel_drv_fmod"; dllName = "nel_drv_fmod";
@ -162,7 +164,9 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD
#endif // NL_OS_UNIX / NL_OS_WINDOWS #endif // NL_OS_UNIX / NL_OS_WINDOWS
break; break;
case DriverOpenAl: case DriverOpenAl:
#ifdef NL_OS_WINDOWS #if defined (NL_COMP_MINGW)
dllName = "libnel_drv_openal_win";
#elif defined (NL_OS_WINDOWS)
dllName = "nel_drv_openal_win"; dllName = "nel_drv_openal_win";
#elif defined (NL_OS_UNIX) #elif defined (NL_OS_UNIX)
dllName = "nel_drv_openal"; dllName = "nel_drv_openal";
@ -171,7 +175,9 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD
#endif #endif
break; break;
case DriverDSound: case DriverDSound:
#ifdef NL_OS_WINDOWS #if defined (NL_COMP_MINGW)
dllName = "libnel_drv_dsound_win";
#elif defined (NL_OS_WINDOWS)
dllName = "nel_drv_dsound_win"; dllName = "nel_drv_dsound_win";
#elif defined (NL_OS_UNIX) #elif defined (NL_OS_UNIX)
nlerror("DriverDSound doesn't exist on Unix because it requires DirectX"); nlerror("DriverDSound doesn't exist on Unix because it requires DirectX");
@ -180,7 +186,9 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD
#endif #endif
break; break;
case DriverXAudio2: case DriverXAudio2:
#ifdef NL_OS_WINDOWS #if defined (NL_COMP_MINGW)
dllName = "libnel_drv_xaudio2_win";
#elif defined (NL_OS_WINDOWS)
dllName = "nel_drv_xaudio2_win"; dllName = "nel_drv_xaudio2_win";
#elif defined (NL_OS_UNIX) #elif defined (NL_OS_UNIX)
nlerror("DriverXAudio2 doesn't exist on Unix because it requires DirectX"); nlerror("DriverXAudio2 doesn't exist on Unix because it requires DirectX");
@ -189,7 +197,9 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD
#endif #endif
break; break;
default: default:
#ifdef NL_OS_WINDOWS #if defined (NL_COMP_MINGW)
dllName = "libnel_drv_xaudio2_win";
#elif defined (NL_OS_WINDOWS)
dllName = "nel_drv_xaudio2_win"; dllName = "nel_drv_xaudio2_win";
#elif defined (NL_OS_UNIX) #elif defined (NL_OS_UNIX)
dllName = "nel_drv_openal"; dllName = "nel_drv_openal";