Improve WinNT 5.1/MinGW support (#10869)

This commit is contained in:
Michał Janiszewski 2020-03-05 19:35:23 +01:00 committed by GitHub
parent 0782692d58
commit 92e5958ab6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 5 deletions

View File

@ -83,6 +83,8 @@ if (WIN32)
else ()
find_library(SDL2_LDFLAGS sdl2)
endif ()
# Hardcode some of the libraries used by mingw builds
target_link_libraries(${PROJECT} imm32 winmm setupapi version)
endif ()
endif ()
if (MSVC)

View File

@ -9,7 +9,7 @@
#ifdef _WIN32
# ifdef __MINGW32__
# if defined(__MINGW32__) && !defined(WINVER) && !defined(_WIN32_WINNT)
// 0x0600 == vista
# define WINVER 0x0600
# define _WIN32_WINNT 0x0600

View File

@ -13,7 +13,7 @@ if (APPLE)
set_source_files_properties(${OPENRCT2_CORE_MM_SOURCES} PROPERTIES COMPILE_FLAGS "-x objective-c++ -fmodules")
endif ()
add_library(${PROJECT_NAME} ${OPENRCT2_CORE_SOURCES} ${OPENRCT2_CORE_MM_SOURCES} ${RCT2_SECTIONS})
add_library(${PROJECT_NAME} ${OPENRCT2_CORE_SOURCES} ${OPENRCT2_CORE_MM_SOURCES})
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
SET_CHECK_CXX_FLAGS(${PROJECT_NAME})
@ -133,6 +133,11 @@ else ()
${LIBZIP_LIBRARIES})
endif ()
if (MINGW)
# Hardcode libraries used by libzip on mingw
target_link_libraries(${PROJECT_NAME} crypto ws2_32)
endif()
if (UNIX AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "BSD")
# Include libdl for dlopen
target_link_libraries(${PROJECT_NAME} dl)

View File

@ -7,7 +7,7 @@
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#ifdef __MINGW32__
#if defined(__MINGW32__) && !defined(WINVER) && !defined(_WIN32_WINNT)
// 0x0600 == vista
# define WINVER 0x0600
# define _WIN32_WINNT 0x0600

View File

@ -22,7 +22,9 @@
# define __USE_SHGETKNOWNFOLDERPATH__
# define __USE_GETDATEFORMATEX__
# else
# define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
# ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
# define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
# endif
# endif
# include "../OpenRCT2.h"

View File

@ -7,7 +7,7 @@
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#ifdef __MINGW32__
#if defined(__MINGW32__) && !defined(WINVER) && !defined(_WIN32_WINNT)
// 0x0600 == vista
# define WINVER 0x0600
# define _WIN32_WINNT 0x0600
@ -50,6 +50,10 @@
# define OPENRCT2_DLL_MODULE_NAME "openrct2.dll"
# if _WIN32_WINNT < 0x600
# define swprintf_s(a, b, c, d, ...) swprintf(a, b, c, ##__VA_ARGS__)
# endif
static HMODULE _dllModule = nullptr;
static HMODULE plaform_get_dll_module()