Skip to content

Commit

Permalink
cmake: add MinGW toolchain files
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Jun 24, 2024
1 parent a0de21f commit 20e2db3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cmake/cross-toolchain-mingw32.cmake
Original file line number Diff line number Diff line change
@@ -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 )
16 changes: 16 additions & 0 deletions cmake/cross-toolchain-mingw64.cmake
Original file line number Diff line number Diff line change
@@ -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 )

0 comments on commit 20e2db3

Please sign in to comment.