From 0c1d92834acb6b09236f4f41976bd94c8235935f Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Tue, 26 Nov 2013 17:58:55 -0500 Subject: [PATCH 1/2] - Fixed: Some setups require the dynamic linking library to be linked explicitly, so specify it when using DYN_FLUIDSYNTH --- src/CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index aa4013503..6c31ca69c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -507,12 +507,14 @@ message( STATUS "Fluid synth libs: ${FLUIDSYNTH_LIBRARIES}" ) set( ZDOOM_LIBS ${ZDOOM_LIBS} "${ZLIB_LIBRARIES}" "${JPEG_LIBRARIES}" "${BZIP2_LIBRARIES}" "${GME_LIBRARIES}" "${FMOD_LIBRARY}" ) include_directories( "${ZLIB_INCLUDE_DIR}" "${FMOD_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GME_INCLUDE_DIR}" ) -if( FLUIDSYNTH_FOUND ) - if( NOT DYN_FLUIDSYNTH) - set( ZDOOM_LIBS ${ZDOOM_LIBS} "${FLUIDSYNTH_LIBRARIES}" ) - include_directories( "${FLUIDSYNTH_INCLUDE_DIR}" ) - endif( NOT DYN_FLUIDSYNTH ) -endif( FLUIDSYNTH_FOUND ) +if( NOT DYN_FLUIDSYNTH) + if( FLUIDSYNTH_FOUND ) + set( ZDOOM_LIBS ${ZDOOM_LIBS} "${FLUIDSYNTH_LIBRARIES}" ) + include_directories( "${FLUIDSYNTH_INCLUDE_DIR}" ) + endif( FLUIDSYNTH_FOUND ) +else( NOT DYN_FLUIDSYNTH ) + set( ZDOOM_LIBS ${ZDOOM_LIBS} ${CMAKE_DL_LIBS} ) +endif( NOT DYN_FLUIDSYNTH ) # Start defining source files for ZDoom set( PLAT_WIN32_SOURCES From 7cb70f60b351f9c4da627455adeea789169f201d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 28 Nov 2013 11:03:19 +0100 Subject: [PATCH 2/2] - removed duplicate #define warning in fmodsound.cpp. - commented out output of Cr0NpxState for floating point state because this variable was renamed in most recent Windows headers. - added CMAKE option to generate assembly output for release builds. - added my CMake-based project directory to .gitignore. --- .gitignore | 1 + CMakeLists.txt | 11 ++++++++--- src/sound/fmodsound.cpp | 2 ++ src/win32/i_crash.cpp | 9 +++++++-- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 09e3fb4c4..e27cd5a59 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ /tools/lemon/build /tools/re2c/build /wadsrc/*.pk3 +/build_vc2013 diff --git a/CMakeLists.txt b/CMakeLists.txt index 625fceb1d..a442b9ea5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,9 +91,14 @@ if( MSVC ) # Disable run-time type information set( ALL_C_FLAGS "/GF /Gy /GR-" ) - # Avoid CRT DLL dependancies in release builds - set( REL_C_FLAGS "/MT /Oy" ) - + # Avoid CRT DLL dependancies in release builds, optionally generate assembly output for checking crash locations. + option( ZDOOM_GENERATE_ASM "Generate assembly output." OFF ) + if( ZDOOM_GENERATE_ASM ) + set( REL_C_FLAGS "/MT /Oy /FAcs" ) + else( ZDOOM_GENERATE_ASM ) + set( REL_C_FLAGS "/MT /Oy" ) + endif( ZDOOM_GENERATE_ASM ) + # Debug allocations in debug builds set( DEB_C_FLAGS "/D _CRTDBG_MAP_ALLOC /MTd" ) diff --git a/src/sound/fmodsound.cpp b/src/sound/fmodsound.cpp index f832183c0..4bdc43081 100644 --- a/src/sound/fmodsound.cpp +++ b/src/sound/fmodsound.cpp @@ -629,7 +629,9 @@ bool FMODSoundRenderer::IsValid() // //========================================================================== +#ifndef FACILITY_VISUALCPP #define FACILITY_VISUALCPP ((LONG)0x6d) +#endif #define VcppException(sev,err) ((sev) | (FACILITY_VISUALCPP<<16) | err) static int CheckException(DWORD code) diff --git a/src/win32/i_crash.cpp b/src/win32/i_crash.cpp index d629bacc9..68d78295d 100644 --- a/src/win32/i_crash.cpp +++ b/src/win32/i_crash.cpp @@ -842,10 +842,15 @@ HANDLE WriteTextReport () Writef (file, "\r\nFPU State:\r\n ControlWord=%04x StatusWord=%04x TagWord=%04x\r\n" " ErrorOffset=%08x\r\n ErrorSelector=%08x\r\n DataOffset=%08x\r\n DataSelector=%08x\r\n" - " Cr0NpxState=%08x\r\n\r\n", + // Cr0NpxState was renamed in recent Windows headers so better skip it here. Its meaning is unknown anyway. + //" Cr0NpxState=%08x\r\n" + "\r\n" + , (WORD)ctxt->FloatSave.ControlWord, (WORD)ctxt->FloatSave.StatusWord, (WORD)ctxt->FloatSave.TagWord, ctxt->FloatSave.ErrorOffset, ctxt->FloatSave.ErrorSelector, ctxt->FloatSave.DataOffset, - ctxt->FloatSave.DataSelector, ctxt->FloatSave.Cr0NpxState); + ctxt->FloatSave.DataSelector + //, ctxt->FloatSave.Cr0NpxState + ); for (i = 0; i < 8; ++i) {