mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-27 15:11:01 +00:00
NEW: Add cross compile support on X86_64 Linux with MinGW toolchain.
This commit is contained in:
@@ -11,7 +11,16 @@ target_include_directories(emulator-common INTERFACE "${CMAKE_CURRENT_LIST_DIR}"
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(emulator-common PUBLIC
|
||||
Threads::Threads
|
||||
zlibstatic
|
||||
)
|
||||
|
||||
if(CMAKE_C_COMPILER MATCHES "/.*/x86_64-w64-mingw32-gcc$")
|
||||
target_link_libraries(emulator-common PUBLIC
|
||||
Threads::Threads
|
||||
zlibstatic
|
||||
ws2_32
|
||||
)
|
||||
else()
|
||||
target_link_libraries(emulator-common PUBLIC
|
||||
Threads::Threads
|
||||
zlibstatic
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -2,8 +2,14 @@
|
||||
|
||||
#if _WIN32
|
||||
#include "../utils/win.hpp"
|
||||
#ifdef __MINGW64__
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <stdint.h>
|
||||
#else
|
||||
#include <WinSock2.h>
|
||||
#include <WS2tcpip.h>
|
||||
#endif
|
||||
#else
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW64__
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user