From c8bfef039aad31c9984c3b93b52009d620d5817d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 10 Mar 2017 21:18:15 +0100 Subject: [PATCH] - removed dependency on windows.h for music_fluidsynth_mididevice.cpp. It just accesses a single function from Windows so let's manually define this so that this file can use precompiled headers. - enable precompiled headers for all non-system-specific MIDI devices. - moved the native Windows and Mac MIDI devices into their respective sections in the project file so that they won't get compiled on the other ones. --- src/CMakeLists.txt | 18 +++++++++--------- .../music_fluidsynth_mididevice.cpp | 6 +++++- .../mididevices/music_timidity_mididevice.cpp | 2 -- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ef9b6534e..0d4b27f06 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -601,6 +601,7 @@ endif() # Start defining source files for ZDoom set( PLAT_WIN32_SOURCES + sound/mididevices/music_win_mididevice.cpp win32/eaxedit.cpp win32/critsec.cpp win32/fb_d3d9.cpp @@ -642,6 +643,7 @@ set( PLAT_UNIX_SOURCES posix/unix/i_specialpaths.cpp posix/unix/iwadpicker_gtk.cpp ) set( PLAT_OSX_SOURCES + sound/mididevices/music_audiotoolbox_mididevice.cpp posix/osx/iwadpicker_cocoa.mm posix/osx/i_specialpaths.mm posix/osx/zdoom.icns ) @@ -910,15 +912,6 @@ set( FASTMATH_SOURCES sound/music_stream.cpp sound/oalsound.cpp sound/sndfile_decoder.cpp - sound/mididevices/music_opldumper_mididevice.cpp - sound/mididevices/music_opl_mididevice.cpp - sound/mididevices/music_pseudo_mididevice.cpp - sound/mididevices/music_fluidsynth_mididevice.cpp - sound/mididevices/music_softsynth_mididevice.cpp - sound/mididevices/music_timidity_mididevice.cpp - sound/mididevices/music_wildmidi_mididevice.cpp - sound/mididevices/music_win_mididevice.cpp - sound/mididevices/music_audiotoolbox_mididevice.cpp sound/mididevices/music_midi_timidity.cpp gl/data/gl_matrix.cpp gl/dynlights/a_dynlight.cpp @@ -1245,6 +1238,13 @@ set (PCH_SOURCES scripting/zscript/zcc_compile.cpp scripting/zscript/zcc_parser.cpp sfmt/SFMT.cpp + sound/mididevices/music_opldumper_mididevice.cpp + sound/mididevices/music_opl_mididevice.cpp + sound/mididevices/music_pseudo_mididevice.cpp + sound/mididevices/music_fluidsynth_mididevice.cpp + sound/mididevices/music_softsynth_mididevice.cpp + sound/mididevices/music_timidity_mididevice.cpp + sound/mididevices/music_wildmidi_mididevice.cpp sound/oplsynth/fmopl.cpp sound/oplsynth/mlopl.cpp sound/oplsynth/mlopl_io.cpp diff --git a/src/sound/mididevices/music_fluidsynth_mididevice.cpp b/src/sound/mididevices/music_fluidsynth_mididevice.cpp index 551c0a10c..711cf7480 100644 --- a/src/sound/mididevices/music_fluidsynth_mididevice.cpp +++ b/src/sound/mididevices/music_fluidsynth_mididevice.cpp @@ -35,9 +35,9 @@ #ifdef HAVE_FLUIDSYNTH // HEADER FILES ------------------------------------------------------------ -#include "i_midi_win32.h" #include "i_musicinterns.h" +#include "i_system.h" #include "templates.h" #include "doomdef.h" #include "m_swap.h" @@ -50,6 +50,10 @@ #ifdef DYN_FLUIDSYNTH #ifdef _WIN32 + +// do this without including windows.h for this one single prototype +extern "C" unsigned __stdcall GetSystemDirectoryA(char *lpBuffer, unsigned uSize); + #ifndef _M_X64 #define FLUIDSYNTHLIB1 "fluidsynth.dll" #define FLUIDSYNTHLIB2 "libfluidsynth.dll" diff --git a/src/sound/mididevices/music_timidity_mididevice.cpp b/src/sound/mididevices/music_timidity_mididevice.cpp index 3d5fb1622..cacddf542 100644 --- a/src/sound/mididevices/music_timidity_mididevice.cpp +++ b/src/sound/mididevices/music_timidity_mididevice.cpp @@ -34,8 +34,6 @@ // HEADER FILES ------------------------------------------------------------ -#include "i_midi_win32.h" - #include "i_musicinterns.h" #include "templates.h" #include "doomdef.h"