@ -15,9 +15,6 @@ add_compile_options("-O2")
# O p t i o n s y o u c a n s e t v i a c o m m a n d - l i n e
option ( HAS_TERMINAL "Show a terminal window for STDOUT/STDERR" ON )
option ( USE_ALSA "Force using ALSA as audio backend (Linux-only)" )
option ( USE_PULSEAUDIO "Force using PulseAudio as audio backend (Linux-only)" )
option ( USE_SDL2_MIXER "Force using SDL2_mixer as audio backend" )
#
# C _ C X X _ S O U R C E S _ D I R
@ -133,8 +130,6 @@ if(APPLE)
target_link_libraries ( ${ OutputExecutable } Threads::Threads )
include_directories ( ${ Threads_INCLUDE_DIRS } )
# S D L 2 _ m i x e r
set ( USE_SDL2_MIXER ON )
find_package ( PNG REQUIRED )
target_link_libraries ( ${ OutputExecutable } PNG::PNG )
@ -169,14 +164,6 @@ if(WIN32 AND MINGW)
set ( DWMAPI_LIBRARY dwmapi )
target_link_libraries ( ${ OutputExecutable } ${ DWMAPI_LIBRARY } )
if ( NOT USE_SDL2_MIXER )
# w i n m m
set ( WINMM_LIBRARY winmm )
target_link_libraries ( ${ OutputExecutable } ${ WINMM_LIBRARY } )
endif ( ) # N O T U S E _ S D L 2 _ M I X E R
# s t d c + + f s
target_link_libraries ( ${ OutputExecutable } stdc++fs )
@ -268,33 +255,6 @@ if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN)
target_include_directories ( ${ OutputExecutable } PRIVATE "${C_CXX_SOURCES_DIR}/steam" )
link_directories ( "Adventures in Lestoria" )
# T O D O : s a n i t y c h e c k s
if ( USE_ALSA )
# A L S A
find_package ( ALSA REQUIRED )
target_link_libraries ( ${ OutputExecutable } ALSA::ALSA )
include_directories ( ${ ALSA_INCLUDE_DIRS } )
add_compile_definitions ( SOUNDWAVE_USING_ALSA=1 )
elseif ( USE_SDL2_MIXER )
# B e c a u s e S D L 2 _ m i x e r c a n b e u s e d o n m u l t i p l e p l a t f o r m s , w e
# d e f e r i t ' s i n c l u s i o n u n t i l o u t s i d e o f t h e p l a t f o r m / t o o l c h a i n
# s e l e c t i o n l o g i c .
else ( ) # P u l s e A u d i o i s D e f a u l t
# P u l s e A u d i o
find_package ( PulseAudio REQUIRED )
target_link_libraries ( ${ OutputExecutable } ${ PULSEAUDIO_LIBRARY } pulse-simple )
include_directories ( ${ PULSEAUDIO_INCLUDE_DIR } )
add_compile_definitions ( SOUNDWAVE_USING_PULSE=1 )
endif ( )
find_package ( PNG REQUIRED )
target_link_libraries ( ${ OutputExecutable } PNG::PNG )
include_directories ( ${ PNG_INCLUDE_DIRS } )
@ -309,6 +269,7 @@ if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN)
target_link_libraries ( ${ OutputExecutable } discord_game_sdk )
target_link_libraries ( ${ OutputExecutable } libsteam_api )
target_link_libraries ( ${ OutputExecutable } dl )
target_link_options (
$ { O u t p u t E x e c u t a b l e }
@ -368,17 +329,6 @@ if (EMSCRIPTEN)
endif ( ) # E m s c r i p t e n
if ( USE_SDL2_MIXER AND NOT EMSCRIPTEN )
# S D L 2 _ m i x e r
find_package ( SDL2_mixer REQUIRED )
target_link_libraries ( ${ OutputExecutable } SDL2_mixer::SDL2_mixer )
add_compile_definitions ( SOUNDWAVE_USING_SDLMIXER=1 )
endif ( ) # U S E _ S D L 2 _ M I X E R
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# S e t i n c l u d e d i r e c t o r y
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #