From a6d3210a9ce48d947000e041aae2fc2e6a67330a Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Fri, 2 Nov 2018 01:05:39 +0000 Subject: [PATCH 1/4] Include missing Windows header before calling Windows-specific functions --- CMakeLists.txt | 6 +++--- components/debug/debugging.hpp | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0296a4030..1d388df72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -276,7 +276,7 @@ if (APPLE) endif (APPLE) # Set up DEBUG define -set_directory_properties(PROPERTIES COMPILE_DEFINITIONS_DEBUG DEBUG=1) +set_directory_properties(PROPERTIES COMPILE_DEFINITIONS $<$:DEBUG=1>) if (NOT APPLE) set(OPENMW_MYGUI_FILES_ROOT ${OpenMW_BINARY_DIR}) @@ -607,7 +607,7 @@ if (WIN32) if (USE_DEBUG_CONSOLE AND BUILD_OPENMW) set_target_properties(openmw PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:CONSOLE") set_target_properties(openmw PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/SUBSYSTEM:CONSOLE") - set_target_properties(openmw PROPERTIES COMPILE_DEFINITIONS_DEBUG "_CONSOLE") + set_target_properties(openmw PROPERTIES COMPILE_DEFINITIONS $<$:_CONSOLE>) elseif (BUILD_OPENMW) # Turn off debug console, debug output will be written to visual studio output instead set_target_properties(openmw PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS") @@ -617,7 +617,7 @@ if (WIN32) if (BUILD_OPENMW) # Release builds don't use the debug console set_target_properties(openmw PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS") - set_target_properties(openmw PROPERTIES COMPILE_DEFINITIONS_RELEASE "_WINDOWS") + set_target_properties(openmw PROPERTIES COMPILE_DEFINITIONS $<$:_WINDOWS>) set_target_properties(openmw PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS") endif() diff --git a/components/debug/debugging.hpp b/components/debug/debugging.hpp index f47f58e45..361f321cb 100644 --- a/components/debug/debugging.hpp +++ b/components/debug/debugging.hpp @@ -44,6 +44,10 @@ namespace Debug }; #if defined(_WIN32) && defined(_DEBUG) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif // !WIN32_LEAN_AND_MEAN +#include class DebugOutput : public DebugOutputBase { public: From a5afae71e6f5315c5e8f7caefa525ff53170758f Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Fri, 2 Nov 2018 17:18:10 +0000 Subject: [PATCH 2/4] Remove unwanted compile definition. --- CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d388df72..1fdeb5672 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,9 +275,6 @@ if (APPLE) "${APP_BUNDLE_DIR}/Contents/Resources/OpenMW.icns" COPYONLY) endif (APPLE) -# Set up DEBUG define -set_directory_properties(PROPERTIES COMPILE_DEFINITIONS $<$:DEBUG=1>) - if (NOT APPLE) set(OPENMW_MYGUI_FILES_ROOT ${OpenMW_BINARY_DIR}) set(OPENMW_SHADERS_ROOT ${OpenMW_BINARY_DIR}) From e2ddb395915f046fab631bc045e8d7ce53099509 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Fri, 2 Nov 2018 17:30:54 +0000 Subject: [PATCH 3/4] Remove incorrect comment --- apps/openmw/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index 176adfad0..7c39a785e 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -7,7 +7,6 @@ #include "engine.hpp" #if defined(_WIN32) -// For OutputDebugString #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif From 719c9f07666229dcf105c3a173dbbf6a8b25bd5a Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Fri, 2 Nov 2018 18:39:46 +0000 Subject: [PATCH 4/4] Remove compile definition which inadvertently broke other compile definitons --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fdeb5672..6fbc42fb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -614,7 +614,6 @@ if (WIN32) if (BUILD_OPENMW) # Release builds don't use the debug console set_target_properties(openmw PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS") - set_target_properties(openmw PROPERTIES COMPILE_DEFINITIONS $<$:_WINDOWS>) set_target_properties(openmw PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS") endif()