|
|
|
@ -15,9 +15,6 @@ add_compile_options("-O2") |
|
|
|
|
|
|
|
|
|
# Options you can set via command-line |
|
|
|
|
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_CXX_SOURCES_DIR |
|
|
|
@ -133,8 +130,6 @@ if(APPLE) |
|
|
|
|
target_link_libraries(${OutputExecutable} Threads::Threads) |
|
|
|
|
include_directories(${Threads_INCLUDE_DIRS}) |
|
|
|
|
|
|
|
|
|
# SDL2_mixer |
|
|
|
|
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) |
|
|
|
|
|
|
|
|
|
# winmm |
|
|
|
|
set(WINMM_LIBRARY winmm) |
|
|
|
|
target_link_libraries(${OutputExecutable} ${WINMM_LIBRARY}) |
|
|
|
|
|
|
|
|
|
endif() # NOT USE_SDL2_MIXER |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# stdc++fs |
|
|
|
|
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") |
|
|
|
|
|
|
|
|
|
# TODO: sanity checks |
|
|
|
|
|
|
|
|
|
if(USE_ALSA) |
|
|
|
|
|
|
|
|
|
# ALSA |
|
|
|
|
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) |
|
|
|
|
|
|
|
|
|
# Because SDL2_mixer can be used on multiple platforms, we |
|
|
|
|
# defer it's inclusion until outside of the platform/toolchain |
|
|
|
|
# selection logic. |
|
|
|
|
|
|
|
|
|
else() # PulseAudio is Default |
|
|
|
|
|
|
|
|
|
# PulseAudio |
|
|
|
|
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( |
|
|
|
|
${OutputExecutable} |
|
|
|
@ -368,17 +329,6 @@ if (EMSCRIPTEN) |
|
|
|
|
endif() # Emscripten |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(USE_SDL2_MIXER AND NOT EMSCRIPTEN) |
|
|
|
|
|
|
|
|
|
# SDL2_mixer |
|
|
|
|
find_package(SDL2_mixer REQUIRED) |
|
|
|
|
target_link_libraries(${OutputExecutable} SDL2_mixer::SDL2_mixer) |
|
|
|
|
|
|
|
|
|
add_compile_definitions(SOUNDWAVE_USING_SDLMIXER=1) |
|
|
|
|
|
|
|
|
|
endif() # USE_SDL2_MIXER |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
###################################################################### |
|
|
|
|
# Set include directory |
|
|
|
|
###################################################################### |
|
|
|
|