From e7d853bb3cb6d00d4ac4db67434ef84f58708c40 Mon Sep 17 00:00:00 2001 From: Yuri Krupenin Date: Sat, 8 Jan 2011 23:58:47 +0300 Subject: [PATCH] Corrected subsystem link flags for MinGW. --- CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index abfea1ebd..5b5a3ad83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -324,6 +324,22 @@ if (WIN32) set_target_properties(openmw PROPERTIES COMPILE_DEFINITIONS_RELEASE "_CONSOLE") set_target_properties(openmw PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:CONSOLE") endif(MSVC) + + # Same for MinGW + if (MINGW) + if (USE_DEBUG_CONSOLE) + set_target_properties(openmw PROPERTIES LINK_FLAGS_DEBUG "-Wl,-subsystem,console") + set_target_properties(openmw PROPERTIES LINK_FLAGS_RELWITHDEBINFO "-Wl,-subsystem,console") + set_target_properties(openmw PROPERTIES COMPILE_DEFINITIONS_DEBUG "_CONSOLE") + else(USE_DEBUG_CONSOLE) + set_target_properties(openmw PROPERTIES LINK_FLAGS_DEBUG "-Wl,-subsystem,windows") + set_target_properties(openmw PROPERTIES LINK_FLAGS_RELWITHDEBINFO "-Wl,-subsystem,windows") + endif(USE_DEBUG_CONSOLE) + + set_target_properties(openmw PROPERTIES LINK_FLAGS_RELEASE "-Wl,-subsystem,console") + set_target_properties(openmw PROPERTIES LINK_FLAGS_MINSIZEREL "-Wl,-subsystem,console") + set_target_properties(openmw PROPERTIES COMPILE_DEFINITIONS_RELEASE "_CONSOLE") + endif(MINGW) # TODO: At some point release builds should not use the console but rather write to a log file #set_target_properties(openmw PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS")