mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-26 16:24:35 +01:00
Fix mingw cmake
This commit is contained in:
@@ -16,6 +16,12 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#ifdef __MINGW32__
|
||||
// 0x0600 == vista
|
||||
#define WINVER 0x0600
|
||||
#define _WIN32_WINNT 0x0600
|
||||
#endif // __MINGW32__
|
||||
|
||||
#include <sstream>
|
||||
#include <openrct2/common.h>
|
||||
#include <openrct2/core/Math.hpp>
|
||||
@@ -31,7 +37,7 @@
|
||||
#include <SDL_syswm.h>
|
||||
|
||||
// Native resource IDs
|
||||
#include "../../../resources/resource.h"
|
||||
#include "../../resources/resource.h"
|
||||
|
||||
static std::wstring SHGetPathFromIDListLongPath(LPCITEMIDLIST pidl)
|
||||
{
|
||||
@@ -191,15 +197,6 @@ namespace OpenRCT2 { namespace Ui
|
||||
}
|
||||
|
||||
result = wmInfo.info.win.window;
|
||||
#ifdef __MINGW32__
|
||||
assert(sizeof(HWND) == sizeof(uint32));
|
||||
uint8 A = (uint32)result & 0xff000000 >> 24;
|
||||
uint8 B = (uint32)result & 0xff0000 >> 16;
|
||||
uint8 C = (uint32)result & 0xff00 >> 8;
|
||||
uint8 D = (uint32)handle & 0xff;
|
||||
result = (HWND)(D << 24 | A << 16 | B << 8 | C);
|
||||
log_warning("twisting bits of handle, a workaround for mingw/sdl bug");
|
||||
#endif // __MINGW32__
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -280,6 +280,9 @@ ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS CXX_WARN_SUGGEST_FINAL_TYPES -Wsugge
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS CXX_WARN_SUGGEST_FINAL_METHODS -Wsuggest-final-methods)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS CXX_WARN_SUGGEST_OVERRIDE -Wsuggest-override)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS CXX_WARN_DUPLICATED_COND -Wduplicated-cond)
|
||||
if (MINGW)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS CXX_WARN_SUGGEST_OVERRIDE -Wno-error=redundant-decls)
|
||||
endif ()
|
||||
|
||||
# Items below are not supported by ICC
|
||||
ADD_CHECK_C_COMPILER_FLAG(CMAKE_C_FLAGS C_WARN_REDUNDANT_DECLS -Wredundant-decls)
|
||||
@@ -311,6 +314,9 @@ endif ()
|
||||
if (ENABLE_LIGHTFX)
|
||||
add_definitions(-D__ENABLE_LIGHTFX__)
|
||||
endif ()
|
||||
if (DISABLE_RCT2)
|
||||
add_definitions(-DNO_RCT2)
|
||||
endif ()
|
||||
|
||||
if (NOT DISABLE_RCT2)
|
||||
# Disable optimizations for addresses.c for all compilers, to allow optimized
|
||||
|
||||
@@ -65,18 +65,7 @@ static HMODULE plaform_get_dll_module()
|
||||
return _dllModule;
|
||||
}
|
||||
|
||||
#ifdef NO_RCT2
|
||||
|
||||
#ifdef __MINGW32__
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
return RunOpenRCT2(argc, argv);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
#ifndef NO_RCT2
|
||||
|
||||
/* DllMain is already defined in one of static libraries we implicitly depend
|
||||
* on (libcrypto), which is their bug really, but since we don't do anything in
|
||||
|
||||
Reference in New Issue
Block a user