From 31db37afd460201d83767b7a4f0cd4933a7b96c1 Mon Sep 17 00:00:00 2001 From: k1ll Date: Wed, 19 Jun 2013 20:22:07 +0200 Subject: [PATCH 01/10] FindMygui mingw --- cmake/FindMyGUI.cmake | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/cmake/FindMyGUI.cmake b/cmake/FindMyGUI.cmake index 40fa2373f0..2829a74d35 100644 --- a/cmake/FindMyGUI.cmake +++ b/cmake/FindMyGUI.cmake @@ -19,7 +19,46 @@ include(PreprocessorUtils) # ENDIF (MYGUI_LIBRARIES AND MYGUI_INCLUDE_DIRS) IF (WIN32) #Windows + MESSAGE(STATUS "Looking for MyGUI") + + IF(MINGW) + + FIND_PATH ( MYGUI_INCLUDE_DIRS MyGUI.h PATH_SUFFIXES MYGUI) + FIND_PATH ( MYGUI_PLATFORM_INCLUDE_DIRS MyGUI_OgrePlatform.h PATH_SUFFIXES MYGUI) + FIND_LIBRARY ( MYGUI_LIBRARIES_REL NAMES + libMyGUIEngine${CMAKE_SHARED_LIBRARY_SUFFIX} + libMyGUI.OgrePlatform${CMAKE_STATIC_LIBRARY_SUFFIX} + HINTS + ${MYGUI_LIB_DIR} + PATH_SUFFIXES "" release relwithdebinfo minsizerel ) + + FIND_LIBRARY ( MYGUI_LIBRARIES_DBG NAMES + libMyGUIEngine_d${CMAKE_SHARED_LIBRARY_SUFFIX} + libMyGUI.OgrePlatform_d${CMAKE_STATIC_LIBRARY_SUFFIX} + HINTS + ${MYGUI_LIB_DIR} + PATH_SUFFIXES "" debug ) + + FIND_LIBRARY ( MYGUI_PLATFORM_LIBRARIES_REL NAMES + libMyGUI.OgrePlatform${CMAKE_STATIC_LIBRARY_SUFFIX} + HINTS + ${MYGUI_LIB_DIR} + PATH_SUFFIXES "" release relwithdebinfo minsizerel ) + + FIND_LIBRARY ( MYGUI_PLATFORM_LIBRARIES_DBG NAMES + MyGUI.OgrePlatform_d${CMAKE_STATIC_LIBRARY_SUFFIX} + HINTS + ${MYGUI_LIB_DIR} + PATH_SUFFIXES "" debug ) + + make_library_set ( MYGUI_LIBRARIES ) + make_library_set ( MYGUI_PLATFORM_LIBRARIES ) + + MESSAGE ("${MYGUI_LIBRARIES}") + MESSAGE ("${MYGUI_PLATFORM_LIBRARIES}") + ENDIF(MINGW) + SET(MYGUISDK $ENV{MYGUI_HOME}) IF (MYGUISDK) findpkg_begin ( "MYGUI" ) From 00b7712a5910932f5bb8e333e6a28883f506092a Mon Sep 17 00:00:00 2001 From: k1ll Date: Sat, 22 Jun 2013 11:33:22 +0200 Subject: [PATCH 02/10] Fix shlwapi include case and add the lib for linking when building for windows --- components/CMakeLists.txt | 4 ++++ components/files/windowspath.cpp | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 38fcd88e3e..5bd18d119e 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -170,6 +170,10 @@ if (GIT_CHECKOUT) add_dependencies (components git-version) endif (GIT_CHECKOUT) +if (WIN32) +target_link_libraries(components shlwapi) +endif() + # Fix for not visible pthreads functions for linker with glibc 2.15 if (UNIX AND NOT APPLE) target_link_libraries(components ${CMAKE_THREAD_LIBS_INIT}) diff --git a/components/files/windowspath.cpp b/components/files/windowspath.cpp index 0df782702d..ece4049a87 100644 --- a/components/files/windowspath.cpp +++ b/components/files/windowspath.cpp @@ -6,9 +6,7 @@ #include #include -#include - -#pragma comment(lib, "Shlwapi.lib") +#include #include namespace bconv = boost::locale::conv; From a230050ec8d4d094a5905b0280173fc3e780a09a Mon Sep 17 00:00:00 2001 From: k1ll Date: Sat, 22 Jun 2013 11:37:17 +0200 Subject: [PATCH 03/10] Boost tr1 unordered map does not work with mingw --- apps/openmw/mwworld/worldimp.cpp | 2 +- components/files/configurationmanager.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 013386f8f9..744057e437 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1,6 +1,6 @@ #include "worldimp.hpp" -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__MINGW32__) #include #elif defined HAVE_UNORDERED_MAP #include diff --git a/components/files/configurationmanager.hpp b/components/files/configurationmanager.hpp index b0b7fea9a9..24b08c5236 100644 --- a/components/files/configurationmanager.hpp +++ b/components/files/configurationmanager.hpp @@ -1,7 +1,7 @@ #ifndef COMPONENTS_FILES_CONFIGURATIONMANAGER_HPP #define COMPONENTS_FILES_CONFIGURATIONMANAGER_HPP -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__MINGW32__) #include #elif defined HAVE_UNORDERED_MAP #include From de247ec94b26f08b15fff61a3fed070a7e06109c Mon Sep 17 00:00:00 2001 From: k1ll Date: Sat, 22 Jun 2013 11:48:52 +0200 Subject: [PATCH 04/10] Fix ifdef --- extern/sdl4ogre/sdlwindowhelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/sdl4ogre/sdlwindowhelper.cpp b/extern/sdl4ogre/sdlwindowhelper.cpp index 637fae0efe..6690e3caba 100644 --- a/extern/sdl4ogre/sdlwindowhelper.cpp +++ b/extern/sdl4ogre/sdlwindowhelper.cpp @@ -30,7 +30,7 @@ SDLWindowHelper::SDLWindowHelper (SDL_Window* window, int w, int h, switch (wmInfo.subsystem) { -#ifdef WIN32 +#ifdef _WIN32 case SDL_SYSWM_WINDOWS: // Windows code winHandle = Ogre::StringConverter::toString((uintptr_t)wmInfo.info.win.window); From c61919501dfb4416797c398a957bcf5259748ed5 Mon Sep 17 00:00:00 2001 From: k1ll Date: Sat, 22 Jun 2013 11:56:18 +0200 Subject: [PATCH 05/10] Fix unnecessary include, ssize_t define and use pretty function instead of funcsig for mingw --- extern/ogre-ffmpeg-videoplayer/audiodecoder.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extern/ogre-ffmpeg-videoplayer/audiodecoder.hpp b/extern/ogre-ffmpeg-videoplayer/audiodecoder.hpp index b05b16d428..fe36ec39f1 100644 --- a/extern/ogre-ffmpeg-videoplayer/audiodecoder.hpp +++ b/extern/ogre-ffmpeg-videoplayer/audiodecoder.hpp @@ -21,8 +21,8 @@ extern "C" #endif } -#ifdef _WIN32 -#include +#if defined(_WIN32) && !defined(__MINGW32__) +#include typedef SSIZE_T ssize_t; #endif From b194af4ab27d35a167c69c9b8f6a6f481017b237 Mon Sep 17 00:00:00 2001 From: k1ll Date: Sat, 6 Jul 2013 13:32:59 +0200 Subject: [PATCH 06/10] Add static qt to components --- components/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 5bd18d119e..e6158c0a25 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -170,6 +170,10 @@ if (GIT_CHECKOUT) add_dependencies (components git-version) endif (GIT_CHECKOUT) +if(MINGW) +target_link_libraries(components ${QT_LIBRARIES}) +endif() + if (WIN32) target_link_libraries(components shlwapi) endif() From 8e094d6fa5ed03434c1fd7e86a1018dc8a895137 Mon Sep 17 00:00:00 2001 From: k1ll Date: Sat, 6 Jul 2013 17:18:11 +0200 Subject: [PATCH 07/10] Add static bullet to components --- components/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index e6158c0a25..01de1c28e1 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -127,6 +127,9 @@ set (ESM_UI ${CMAKE_SOURCE_DIR}/files/ui/contentselector.ui ) find_package(Qt4 COMPONENTS QtCore QtGui) +if(MINGW) +find_package(Bullet REQUIRED COMPONENTS Collision) +endif() if(QT_QTGUI_LIBRARY AND QT_QTCORE_LIBRARY) add_component_qt_dir (contentselector @@ -171,7 +174,7 @@ if (GIT_CHECKOUT) endif (GIT_CHECKOUT) if(MINGW) -target_link_libraries(components ${QT_LIBRARIES}) +target_link_libraries(components ${QT_LIBRARIES} ${BULLET_LIBRARIES}) endif() if (WIN32) From fe03727ae5fa6e598b151122ad5f3878e52b2e3c Mon Sep 17 00:00:00 2001 From: k1ll Date: Tue, 6 Aug 2013 18:55:17 +0200 Subject: [PATCH 08/10] Don't force linking static boost libraries when building with mingw --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 07fffd5776..2c83e26627 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,9 +134,11 @@ endif() # Platform specific if (WIN32) + if(NOT MINGW) set(Boost_USE_STATIC_LIBS ON) set(PLATFORM_INCLUDE_DIR "platform") add_definitions(-DBOOST_ALL_NO_LIB) + endif(NOT MINGW) # Suppress WinMain(), provided by SDL add_definitions(-DSDL_MAIN_HANDLED) From 96d9afec384d16de4876c3e3b74a190afee28732 Mon Sep 17 00:00:00 2001 From: k1ll Date: Fri, 23 May 2014 23:26:05 +0200 Subject: [PATCH 09/10] More header case fixes --- apps/openmw/main.cpp | 2 +- extern/oics/tinyxml.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index 070136dfd7..2d2c9af0c9 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -15,7 +15,7 @@ #if defined(_WIN32) // For OutputDebugString #define WIN32_LEAN_AND_MEAN -#include +#include // makes __argc and __argv available on windows #include #endif diff --git a/extern/oics/tinyxml.cpp b/extern/oics/tinyxml.cpp index 21b2d9c9a3..5d8eb475a0 100644 --- a/extern/oics/tinyxml.cpp +++ b/extern/oics/tinyxml.cpp @@ -32,7 +32,7 @@ distribution. #include "tinyxml.h" #ifdef _WIN32 -#include // import MultiByteToWideChar +#include // import MultiByteToWideChar #endif From 901ee5b756ab1d156e055ccf1f5d0624d240c53b Mon Sep 17 00:00:00 2001 From: k1ll Date: Fri, 23 May 2014 23:35:28 +0200 Subject: [PATCH 10/10] Add flag for mingw-w64 unicode support --- apps/mwiniimporter/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/mwiniimporter/CMakeLists.txt b/apps/mwiniimporter/CMakeLists.txt index 790d47dc47..753c86fef6 100644 --- a/apps/mwiniimporter/CMakeLists.txt +++ b/apps/mwiniimporter/CMakeLists.txt @@ -18,6 +18,10 @@ target_link_libraries(openmw-iniimporter components ) +if (MINGW) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -municode") +endif() + if (BUILD_WITH_CODE_COVERAGE) add_definitions (--coverage) target_link_libraries(openmw-iniimporter gcov)