| 1 |
# Inspired from https://www.mingw-w64.org/build-systems/cmake/ |
| 2 |
|
| 3 |
set(CMAKE_SYSTEM_NAME Windows) |
| 4 |
set(CMAKE_SYSTEM_PROCESSOR x86_64) |
| 5 |
|
| 6 |
# Specify the cross compiler |
| 7 |
set(CMAKE_C_COMPILER x86_64-w64-mingw32ucrt-gcc) |
| 8 |
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32ucrt-g++) |
| 9 |
set(CMAKE_Fortran_COMPILER x86_64-w64-mingw32ucrt-gfortran) |
| 10 |
|
| 11 |
# See comments in windows/mingw-cross.ini |
| 12 |
set(CMAKE_C_FLAGS_INIT "-march=nocona -msahf -mtune=generic") |
| 13 |
set(CMAKE_CXX_FLAGS_INIT "-march=nocona -msahf -mtune=generic") |
| 14 |
set(CMAKE_Fortran_FLAGS_INIT "-march=nocona -msahf -mtune=generic") |
| 15 |
|
| 16 |
# Where is the target environment |
| 17 |
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32ucrt) |
| 18 |
|
| 19 |
# Search for programs in the build host directories |
| 20 |
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) |
| 21 |
# For libraries and headers in the target directories |
| 22 |
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) |
| 23 |
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |