aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
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})