Skip to content

Commit

Permalink
Fix cmake build if libvgm is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
superctr committed Sep 15, 2022
1 parent 3d2586b commit 5ada04e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ add_executable(mmlgui
src/miniz.c)

target_link_libraries(mmlgui PRIVATE ctrmml gui vgm-utils vgm-audio vgm-emu)
target_compile_definitions(mmlgui PRIVATE -DLOCAL_LIBVGM)

if(CPPUNIT_FOUND)
add_executable(mmlgui_unittest
Expand Down
5 changes: 5 additions & 0 deletions src/audio_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@

#include <cstring>

#if defined(LOCAL_LIBVGM)
#include "audio/AudioStream.h"
#include "audio/AudioStream_SpcDrvFuns.h"
#else
#include <vgm/audio/AudioStream.h>
#include <vgm/audio/AudioStream_SpcDrvFuns.h>
#endif

//! First time initialization
Audio_Manager::Audio_Manager()
Expand Down
5 changes: 5 additions & 0 deletions src/audio_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
#include <string>
#include <mutex>

#if defined(LOCAL_LIBVGM)
#include "audio/AudioStream.h"
#include "emu/Resampler.h"
#else
#include <vgm/audio/AudioStream.h>
#include <vgm/emu/Resampler.h>
#endif

//! Abstract class for audio stream control
class Audio_Stream
Expand Down
8 changes: 8 additions & 0 deletions src/emu_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@
#include "platform/md.h"
#include "input.h"

#if defined(LOCAL_LIBVGM)
#include "emu/EmuStructs.h"
#include "emu/SoundEmu.h"
#include "emu/SoundDevs.h"
#include "emu/EmuCores.h"
#include "emu/cores/sn764intf.h"
#else
#include <vgm/emu/EmuStructs.h>
#include <vgm/emu/SoundEmu.h>
#include <vgm/emu/SoundDevs.h>
#include <vgm/emu/EmuCores.h>
#include <vgm/emu/cores/sn764intf.h>
#endif

#include <cstdlib>
#include <stdexcept>
Expand Down
6 changes: 6 additions & 0 deletions src/emu_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@
#include <map>
#include <vector>

#if defined(LOCAL_LIBVGM)
#include "emu/EmuStructs.h"
#include "emu/SoundEmu.h"
#include "emu/Resampler.h"
#else
#include <vgm/emu/EmuStructs.h>
#include <vgm/emu/SoundEmu.h>
#include <vgm/emu/Resampler.h>
#endif

#include "audio_manager.h"
#include "vgm.h"
Expand Down

0 comments on commit 5ada04e

Please sign in to comment.