From 15a7cc06740ae53d5a5db89a6c1591038c63c9c8 Mon Sep 17 00:00:00 2001 From: Yuri Krupenin Date: Tue, 4 Jan 2011 14:40:28 +0300 Subject: [PATCH] That should solve link-time problems when building with mingw. Not supplying "SUBSYSTEM:" flags to mingw linker. Linking mygui with libwinmm - should resolve reference to timeGetTime(). --- CMakeLists.txt | 24 ++++++++++--------- extern/mygui_3.0.1/MyGUIEngine/CMakeLists.txt | 4 ++++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ad1c5a9e..abfea1ebd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -308,22 +308,24 @@ if (BUILD_ESMTOOL) endif() if (WIN32) + if (MSVC) if (USE_DEBUG_CONSOLE) - 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 LINK_FLAGS_DEBUG "/SUBSYSTEM:CONSOLE") + set_target_properties(openmw PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/SUBSYSTEM:CONSOLE") + set_target_properties(openmw PROPERTIES COMPILE_DEFINITIONS_DEBUG "_CONSOLE") else() - # Turn off debug console, debug output will be written to visual studio output instead - set_target_properties(openmw PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS") - set_target_properties(openmw PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/SUBSYSTEM:WINDOWS") + # Turn off debug console, debug output will be written to visual studio output instead + set_target_properties(openmw PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS") + set_target_properties(openmw PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/SUBSYSTEM:WINDOWS") endif() - + # Release builds use the debug console set_target_properties(openmw PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:CONSOLE") set_target_properties(openmw PROPERTIES COMPILE_DEFINITIONS_RELEASE "_CONSOLE") set_target_properties(openmw PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:CONSOLE") - - # 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") - #set_target_properties(openmw PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS") + endif(MSVC) + + # 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") + #set_target_properties(openmw PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS") endif() diff --git a/extern/mygui_3.0.1/MyGUIEngine/CMakeLists.txt b/extern/mygui_3.0.1/MyGUIEngine/CMakeLists.txt index 2089470b4..5e1b24e62 100644 --- a/extern/mygui_3.0.1/MyGUIEngine/CMakeLists.txt +++ b/extern/mygui_3.0.1/MyGUIEngine/CMakeLists.txt @@ -26,3 +26,7 @@ if (MYGUI_USE_FREETYPE) endif() target_link_libraries(${PROJECT_NAME} ${CMAKE_DL_LIBS} uuid) + +if (MINGW) + target_link_libraries(${PROJECT_NAME} libwinmm.a) +endif (MINGW)