Files
UnrealEngine/Engine/Source/ThirdParty/Imath/Imath-3.1.12/cmake/Toolchain-mingw.cmake
2025-05-18 13:04:45 +08:00

33 lines
1.1 KiB
CMake

# SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenEXR Project.
# This is only an example of cross compiling, but to compile for windows
# under linux, have the relevant bits installed, and
# validate the find path below
#
# Then to run, do something like
# mkdir win32_cross
# cd win32_cross
# cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw.cmake -DCMAKE_INSTALL_PREFIX=/tmp/win32 ..
# or for static libs only
# cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw.cmake -DCMAKE_INSTALL_PREFIX=/tmp/win32 ..
# make
#
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_CROSSCOMPILING_EMULATOR wine)
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_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
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)