Fix linking of OpenAL driver under MinGW

This commit is contained in:
kaetemi 2014-06-18 00:28:08 +02:00
parent 6807d72136
commit fc9dc1471a
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)
IF(WIN32)
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)
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.
//exit(EXIT_SUCCESS);
#ifdef NL_OS_WINDOWS
#ifndef NL_COMP_MINGW
// disable the Windows popup telling that the application aborted and disable the dr watson report.
_set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
#endif
#endif
// quit without calling atexit or static object dtors.
abort();

View file

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

View file

@ -92,7 +92,12 @@ NLMISC_DECL_PURE_LIB(CSoundDriverALNelLibrary)
* Sound driver instance creation
*/
#ifdef NL_OS_WINDOWS
#ifdef NL_COMP_MINGW
#ifndef NL_STATIC
extern "C"
{
#endif
#endif
// ******************************************************************
#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)
#ifndef NL_STATIC

View file

@ -153,7 +153,9 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD
switch(driverType)
{
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";
#elif defined (NL_OS_UNIX)
dllName = "nel_drv_fmod";
@ -162,7 +164,9 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD
#endif // NL_OS_UNIX / NL_OS_WINDOWS
break;
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";
#elif defined (NL_OS_UNIX)
dllName = "nel_drv_openal";
@ -171,7 +175,9 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD
#endif
break;
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";
#elif defined (NL_OS_UNIX)
nlerror("DriverDSound doesn't exist on Unix because it requires DirectX");
@ -180,7 +186,9 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD
#endif
break;
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";
#elif defined (NL_OS_UNIX)
nlerror("DriverXAudio2 doesn't exist on Unix because it requires DirectX");
@ -189,7 +197,9 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD
#endif
break;
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";
#elif defined (NL_OS_UNIX)
dllName = "nel_drv_openal";