mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
g
This commit is contained in:
parent
ebda608938
commit
26df9f3f3c
2 changed files with 6 additions and 35 deletions
|
|
@ -7,7 +7,6 @@ option(STEAM "Build for Steam" OFF)
|
|||
option(DEBUG "Debug mode" ON)
|
||||
option(SANITIZERS "Enable sanitizers" OFF)
|
||||
option(NATIVE "Use native instructions(for local use only)" OFF)
|
||||
option(LINUX_CROSSCOMPILATION "Forces MiNGW use" OFF)
|
||||
option(STATIC "Build more static build" OFF)
|
||||
option(CPU_ARCH "CPU arch(x86, arm64, ia-64)" "x86")
|
||||
|
||||
|
|
@ -23,31 +22,6 @@ if(STATIC)
|
|||
set(OPENSSL_USE_STATIC_LIBS ON)
|
||||
endif()
|
||||
|
||||
# https://www.mingw-w64.org/build-systems/cmake/
|
||||
if(LINUX_CROSSCOMPILATION)
|
||||
# toolchain-mingw64.cmake
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
|
||||
# specify the cross compiler
|
||||
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)
|
||||
|
||||
# where is the target environment
|
||||
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
|
||||
|
||||
# search for programs in the build host directories
|
||||
# set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
# for libraries and headers in the target directories
|
||||
# set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
# set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
|
||||
# CMake determines how to examine dependencies based on the *host* system, leading to
|
||||
# a `file unknown error` unless the target platform is explicitly specified.
|
||||
set(CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM "windows+pe")
|
||||
endif()
|
||||
|
||||
# main stuff
|
||||
set(MAIN_HEADERS
|
||||
src/quadarray.h
|
||||
|
|
@ -426,15 +400,6 @@ else()
|
|||
)
|
||||
endif()
|
||||
|
||||
if(LINUX_CROSSCOMPILATION)
|
||||
target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE
|
||||
/usr/x86_64-w64-mingw32/include
|
||||
)
|
||||
target_compile_options(oneshot PRIVATE
|
||||
-idirafter /usr/x86_64-w64-mingw32/include
|
||||
)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0167) # suppress Boost warning
|
||||
cmake_policy(SET CMP0167 OLD)
|
||||
endif()
|
||||
|
|
|
|||
6
toolchain/linux_to_windows_mingw_w64.cmake
Normal file
6
toolchain/linux_to_windows_mingw_w64.cmake
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
|
||||
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
|
||||
set(CMAKE_SYSROOT /usr/x86_64-w64-mingw32)
|
||||
Loading…
Reference in a new issue