aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-10-07 06:36:58 -0700
committerChris Robinson <[email protected]>2013-10-07 06:36:58 -0700
commitb5fece03812dfe8edc1d3a613f3328a2df34f4cd (patch)
treeb650171925807823fcb8eea0325e21223d001590
parent1461903e0d713185875ab9d3ecc40ab922acb163 (diff)
Add a CMake option to not define the IDs used on Windows
This includes the GUIDs, IIDs, CLSID, and PropertyKeys. It is up to the user to ensure the appropriate IDs are defined when linked.
-rw-r--r--Alc/helpers.c3
-rw-r--r--CMakeLists.txt13
2 files changed, 16 insertions, 0 deletions
diff --git a/Alc/helpers.c b/Alc/helpers.c
index fe1318ce..1eadc99c 100644
--- a/Alc/helpers.c
+++ b/Alc/helpers.c
@@ -28,6 +28,7 @@
#include <malloc.h>
#endif
+#ifndef AL_NO_UID_DEFS
#if defined(HAVE_GUIDDEF_H) || defined(HAVE_INITGUID_H)
#define INITGUID
#include <windows.h>
@@ -52,6 +53,8 @@ DEFINE_GUID(IID_IAudioRenderClient, 0xf294acfc, 0x3146, 0x4483, 0xa7,0xbf, 0xa
DEFINE_DEVPROPKEY(DEVPKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80,0x20, 0x67,0xd1,0x46,0xa8,0x50,0xe0, 14);
#endif
#endif
+#endif /* AL_NO_UID_DEFS */
+
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 44903eb3..0b553b43 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,6 +31,13 @@ OPTION(ALSOFT_CPUEXT_NEON "Check for ARM Neon support" ON)
OPTION(ALSOFT_REQUIRE_SSE "Require SSE/SSE2 support" OFF)
OPTION(ALSOFT_REQUIRE_NEON "Require ARM Neon support" OFF)
+IF(WIN32)
+ # This option is mainly for static linking OpenAL Soft into another project
+ # that already defines the IDs. It is up to that project to ensure all
+ # required IDs are defined.
+ OPTION(ALSOFT_NO_UID_DEFS "Do not define GUIDs, IIDs, CLSIDs, or PropertyKeys" OFF)
+ENDIF()
+
OPTION(ALSOFT_BACKEND_ALSA "Check for ALSA backend" ON)
OPTION(ALSOFT_BACKEND_OSS "Check for OSS backend" ON)
@@ -140,6 +147,9 @@ ENDIF()
INCLUDE_DIRECTORIES("${OpenAL_SOURCE_DIR}/include" "${OpenAL_BINARY_DIR}")
IF(CMAKE_VERSION VERSION_LESS "2.8.8")
INCLUDE_DIRECTORIES("${OpenAL_SOURCE_DIR}/OpenAL32/Include")
+ IF(WIN32 AND ALSOFT_NO_UID_DEFS)
+ ADD_DEFINITIONS("-DAL_NO_UID_DEFS")
+ ENDIF()
ENDIF()
IF(NOT CMAKE_BUILD_TYPE)
@@ -815,6 +825,9 @@ CONFIGURE_FILE(
# Build a library
ADD_LIBRARY(${LIBNAME} ${LIBTYPE} ${OPENAL_OBJS} ${ALC_OBJS})
SET_PROPERTY(TARGET ${LIBNAME} APPEND PROPERTY COMPILE_DEFINITIONS AL_BUILD_LIBRARY AL_ALEXT_PROTOTYPES)
+IF(WIN32 AND ALSOFT_NO_UID_DEFS)
+ SET_PROPERTY(TARGET ${LIBNAME} APPEND PROPERTY COMPILE_DEFINITIONS AL_NO_UID_DEFS)
+ENDIF()
SET_PROPERTY(TARGET ${LIBNAME} APPEND PROPERTY INCLUDE_DIRECTORIES "${OpenAL_SOURCE_DIR}/OpenAL32/Include")
SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES VERSION ${LIB_VERSION}
SOVERSION ${LIB_MAJOR_VERSION})