aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
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 /CMakeLists.txt
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.
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})