From 20e2db3963be765ece0eccc5b5e39cd41c53fb77 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 24 Jun 2024 14:05:13 +0200 Subject: [PATCH] cmake: add MinGW toolchain files --- cmake/cross-toolchain-mingw32.cmake | 16 ++++++++++++++++ cmake/cross-toolchain-mingw64.cmake | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 cmake/cross-toolchain-mingw32.cmake create mode 100644 cmake/cross-toolchain-mingw64.cmake diff --git a/cmake/cross-toolchain-mingw32.cmake b/cmake/cross-toolchain-mingw32.cmake new file mode 100644 index 00000000..3c97d7a0 --- /dev/null +++ b/cmake/cross-toolchain-mingw32.cmake @@ -0,0 +1,16 @@ +# Target operating system and architecture +set( CMAKE_SYSTEM_NAME Windows ) +set( CMAKE_SYSTEM_PROCESSOR x86 ) + +# C/C++ compilers +set( CMAKE_C_COMPILER i686-w64-mingw32-gcc ) +set( CMAKE_CXX_COMPILER i686-w64-mingw32-g++ ) +set( CMAKE_RC_COMPILER i686-w64-mingw32-windres ) + +# Target prefix +set( CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 ) + +# Find programs using host paths and headers/libraries using target paths +set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) +set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) +set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) diff --git a/cmake/cross-toolchain-mingw64.cmake b/cmake/cross-toolchain-mingw64.cmake new file mode 100644 index 00000000..fb308a45 --- /dev/null +++ b/cmake/cross-toolchain-mingw64.cmake @@ -0,0 +1,16 @@ +# Target operating system and architecture +set( CMAKE_SYSTEM_NAME Windows ) +set( CMAKE_SYSTEM_PROCESSOR x86_64 ) + +# C/C++ compilers +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 ) + +# Target prefix +set( CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 ) + +# Find programs using host paths and headers/libraries using target paths +set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) +set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) +set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )