mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 13:05:53 +08:00
Build: Add MinGW cross-compilation support
This commit is contained in:
1 parent
18726e59f4
commit
3842585777
4 files changed
+28
-1
No files matched your search
@@ -4,3 +4,4 @@ debug/*
|
||||
UserDir/*
|
||||
CMakeCache.txt
|
||||
examples/loop/loop.class
|
||||
build-mingw/*
|
||||
@@ -17,6 +17,18 @@
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mingw-release",
|
||||
"inherits": "ninja-release",
|
||||
"binaryDir": "${sourceDir}/build-mingw",
|
||||
"toolchainFile": "${sourceDir}/toolchains/x86_64-w64-mingw32.cmake"
|
||||
},
|
||||
{
|
||||
"name": "mingw-debug",
|
||||
"inherits": "ninja-debug",
|
||||
"binaryDir": "${sourceDir}/build-mingw",
|
||||
"toolchainFile": "${sourceDir}/toolchains/x86_64-w64-mingw32.cmake"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
||||
#include <Winsock2.h>
|
||||
#include <winsock2.h>
|
||||
|
||||
#include <windows.h>
|
||||
#include <intrin.h>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_PROCESSOR amd64)
|
||||
|
||||
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
|
||||
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
|
||||
|
||||
set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
Reference in new issue
Block a user