aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-03-10 02:46:42 -0700
committerChris Robinson <[email protected]>2009-03-10 02:46:42 -0700
commit8ee47d557356bbd358c2197a1a6a535b32c89820 (patch)
tree64e2edb3abaf415cea5262b453bf382f30c5a458 /CMakeLists.txt
parent9e8801141716e52fd6897eb23cc116e08661814b (diff)
Dynamically load dsound when possible
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 11 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 784713d2..f74dcd20 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -289,16 +289,17 @@ ENDIF()
IF(DSOUND)
CHECK_INCLUDE_FILE(dsound.h HAVE_DSOUND_H)
IF(HAVE_DSOUND_H)
- SET(HAVE_DSOUND 1)
- SET(ALC_OBJS ${ALC_OBJS} Alc/dsound.c)
- SET(BACKENDS "${BACKENDS} DirectSound,")
-
- SET(CMAKE_REQUIRED_LIBRARIES dsound)
- CHECK_C_SOURCE_COMPILES("int main() {return 0;}" HAVE_LIBDSOUND)
- SET(CMAKE_REQUIRED_LIBRARIES "")
-# CHECK_LIBRARY_EXISTS(dsound DirectSoundCreate "" HAVE_LIBDSOUND)
- IF(HAVE_LIBDSOUND)
- SET(EXTRA_LIBS dsound ${EXTRA_LIBS})
+ CHECK_LIBRARY_EXISTS(dsound DirectSoundCreate "" HAVE_LIBDSOUND)
+ IF(HAVE_LIBDSOUND OR WIN32)
+ SET(HAVE_DSOUND 1)
+ SET(ALC_OBJS ${ALC_OBJS} Alc/dsound.c)
+
+ IF(WIN32)
+ SET(BACKENDS "${BACKENDS} DirectSound,")
+ ELSE()
+ SET(BACKENDS "${BACKENDS} DirectSound \(linked\),")
+ SET(EXTRA_LIBS dsound ${EXTRA_LIBS})
+ ENDIF()
ENDIF()
ENDIF()
ENDIF()