From a249fcbab34e691cfc137339596657dabf939f62 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 1 May 2019 10:17:44 +0800 Subject: [PATCH] Support build with OpenAL-Soft on Windows --- code/nel/src/sound/driver/openal/CMakeLists.txt | 7 +++++-- code/nel/src/sound/driver/openal/ext_al.h | 12 ++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/code/nel/src/sound/driver/openal/CMakeLists.txt b/code/nel/src/sound/driver/openal/CMakeLists.txt index 911214a57..22b3f4348 100644 --- a/code/nel/src/sound/driver/openal/CMakeLists.txt +++ b/code/nel/src/sound/driver/openal/CMakeLists.txt @@ -36,8 +36,11 @@ NL_ADD_LIB_SUFFIX(${NLDRV_AL_LIB}) IF(WIN32) # Find and include EFX-Util on Windows. FIND_PACKAGE(EFXUtil) - INCLUDE_DIRECTORIES(${EFXUTIL_INCLUDE_DIR}) - TARGET_LINK_LIBRARIES(${NLDRV_AL_LIB} ${EFXUTIL_LIBRARY}) + IF(EFXUTIL_FOUND) + INCLUDE_DIRECTORIES(${EFXUTIL_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(${NLDRV_AL_LIB} ${EFXUTIL_LIBRARY}) + ADD_DEFINITIONS(-DEFX_CREATIVE_AVAILABLE=1) + ENDIF() ENDIF() IF(WITH_PCH) diff --git a/code/nel/src/sound/driver/openal/ext_al.h b/code/nel/src/sound/driver/openal/ext_al.h index 0b7eaa2bf..b87cf48f2 100644 --- a/code/nel/src/sound/driver/openal/ext_al.h +++ b/code/nel/src/sound/driver/openal/ext_al.h @@ -17,12 +17,12 @@ #ifndef NL_EXT_AL_H #define NL_EXT_AL_H -#ifdef NL_OS_WINDOWS -# define EFX_CREATIVE_AVAILABLE 1 -# define EAX_AVAILABLE 0 -#else -# define EFX_CREATIVE_AVAILABLE 0 -# define EAX_AVAILABLE 0 +#ifndef EFX_CREATIVE_AVAILABLE +#define EFX_CREATIVE_AVAILABLE 0 +#endif + +#ifndef EAX_AVAILABLE +#define EAX_AVAILABLE 0 #endif #if EAX_AVAILABLE