Skip to content

Commit

Permalink
Merge pull request #823 from damiencarol/master
Browse files Browse the repository at this point in the history
Enable compilation without sound
  • Loading branch information
WALLOFJUSTICE authored Feb 26, 2024
2 parents 84f36b5 + c278323 commit 6776e70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,13 @@ find_package(PhysFS REQUIRED)
find_package(RapidJson REQUIRED)
INCLUDE_DIRECTORIES(${RAPID_JSON_INCLUDE_DIR})
LINK_DIRECTORIES(${RAPID_JSON_LINK_DIR})
find_package(NFD REQUIRED)
INCLUDE_DIRECTORIES(${NFD_INCLUDE_DIR})
LINK_DIRECTORIES(${NFD_LIBRARY})

if (STEAMWORKS_ENABLED)
find_package(NFD REQUIRED)
INCLUDE_DIRECTORIES(${NFD_INCLUDE_DIR})
LINK_DIRECTORIES(${NFD_LIBRARY})
ENDIF (STEAMWORKS_ENABLED)

INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS} ${SDL2_INCLUDE_DIR} ${SDL2IMAGE_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIR} ${SDL2NET_INCLUDE_DIR} ${SDL2_NET_INCLUDE_DIRS} ${SDL2TTF_INCLUDE_DIR} ${SDL2_TTF_INCLUDE_DIRS} ${PHYSFS_INCLUDE_DIR})
LINK_DIRECTORIES(${SDL2_LINK_DIRS} ${SDL2_LINK_DIR} ${SDL2IMAGE_LINK_DIRS} ${SDL2_IMAGE_LINK_DIR} ${SDL2NET_LINK_DIR} ${SDL2_NET_LINK_DIRS} ${SDL2TTF_LINK_DIR} ${SDL2_TTF_LINK_DIRS} ${PHYSFS_LINK_DIR})

Expand Down Expand Up @@ -444,6 +448,7 @@ if (GAME_ENABLED)
target_link_libraries(barony ${SDL2_LIBRARIES} ${SDL2_LIBRARY} ${SDL2IMAGE_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${SDL2_NET_LIBRARIES} ${SDL2_TTF_LIBRARIES} ${SDL2TTF_LIBRARY})
if (STEAMWORKS_ENABLED)
target_link_libraries(barony ${STEAMWORKS_LIBRARY})
target_link_libraries(barony ${NFD_LIBRARY})
endif()
if (EOS_ENABLED)
target_link_libraries(barony ${EOS_LIBRARIES})
Expand Down Expand Up @@ -485,7 +490,6 @@ if (GAME_ENABLED)
target_link_libraries(barony ${FMOD_LIBRARY})
endif()
target_link_libraries(barony ${PHYSFS_LIBRARY})
target_link_libraries(barony ${NFD_LIBRARY})
if(NOT APPLE)
#Remember, Mac isn't using find_package for PNG.
target_link_libraries(barony ${PNG_LIBRARY})
Expand Down
4 changes: 3 additions & 1 deletion src/engine/audio/music.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

bool loadMusic()
{
#ifdef USE_FMOD
if ( NUMMINESMUSIC > 0 )
{
minesmusic = (FMOD::Sound**)malloc(sizeof(FMOD::Sound*) * NUMMINESMUSIC);
Expand Down Expand Up @@ -74,7 +75,8 @@ bool loadMusic()
intromusic = (FMOD::Sound**)malloc(sizeof(FMOD::Sound*) * NUMINTROMUSIC);
memset(intromusic, 0, sizeof(FMOD::Sound*) * NUMINTROMUSIC);
}

#endif

bool introMusicChanged;
physfsReloadMusic(introMusicChanged, true);
return true;
Expand Down

0 comments on commit 6776e70

Please sign in to comment.