feat(build): to compile with FMOD support, WHOA_BUILD_FMOD must be passed into CMake

This commit is contained in:
superp00t 2024-07-21 18:39:52 -04:00
parent 5f3eadea1e
commit 2a46ce4d6d
3 changed files with 124 additions and 110 deletions

View File

@ -57,7 +57,7 @@ endif()
if (WHOA_SYSTEM_WIN OR WHOA_SYSTEM_LINUX) if (WHOA_SYSTEM_WIN OR WHOA_SYSTEM_LINUX)
target_link_libraries(gx target_link_libraries(gx
PRIVATE PRIVATE
SDL3::SDL3-static SDL2::SDL2-static
libglew_static libglew_static
) )
endif() endif()

View File

@ -13,6 +13,9 @@ target_link_libraries(sound
PRIVATE PRIVATE
ui ui
util util
PUBLIC
fmod
) )
if(WHOA_BUILD_FMOD)
target_link_libraries(sound PUBLIC fmod)
endif()

13
vendor/CMakeLists.txt vendored
View File

@ -14,8 +14,8 @@ endif()
# FMOD # FMOD
if(defined WHOA_BUILD_FMOD)
add_library(fmod SHARED IMPORTED GLOBAL) add_library(fmod SHARED IMPORTED GLOBAL)
# Determine which flavor of FMOD to use: # Determine which flavor of FMOD to use:
# - macOS versions from 10.9 down prefer FMOD Ex # - macOS versions from 10.9 down prefer FMOD Ex
# - macOS versions from 10.10 up prefer FMOD Core # - macOS versions from 10.10 up prefer FMOD Core
@ -125,3 +125,14 @@ elseif(WHOA_SYSTEM_MAC)
install(FILES ${FMOD_DIR}/mac/lib/libfmod.dylib DESTINATION "bin") install(FILES ${FMOD_DIR}/mac/lib/libfmod.dylib DESTINATION "bin")
endif() endif()
endif() endif()
add_definitions(-DWHOA_BUILD_FMOD)
if(WHOA_FMOD_CORE)
add_definitions(-DWHOA_FMOD_CORE)
endif()
if (WHOA_FMOD_EX)
add_definitions(-DWHOA_FMOD_EX)
endif()
endif()