mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix mingw cmake
This commit is contained in:
parent
69feeafb3f
commit
3ebf5be3ea
|
@ -83,7 +83,11 @@ install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" --build \"${CMAKE_CUR
|
|||
install(CODE "file(DOWNLOAD ${TITLE_SEQUENCE_URL} \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/share/${PROJECT}/title/title-sequences.zip EXPECTED_HASH SHA1=${TITLE_SEQUENCE_SHA1} SHOW_PROGRESS)")
|
||||
install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/share/${PROJECT}/title/ \"${CMAKE_COMMAND}\" -E tar xvf title-sequences.zip)")
|
||||
install(CODE "file(REMOVE \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/share/${PROJECT}/title/title-sequences.zip)")
|
||||
install(TARGETS "libopenrct2" LIBRARY DESTINATION lib)
|
||||
if (WIN32)
|
||||
install(TARGETS "libopenrct2" RUNTIME DESTINATION bin)
|
||||
else()
|
||||
install(TARGETS "libopenrct2" LIBRARY DESTINATION lib)
|
||||
endif()
|
||||
install(TARGETS "openrct2" RUNTIME DESTINATION bin)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/g2.dat" DESTINATION "share/openrct2")
|
||||
install(DIRECTORY "data/" DESTINATION "share/openrct2")
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue