diff options
author | Mathias Preiner <mathias.preiner@gmail.com> | 2018-09-18 17:20:25 -0700 |
---|---|---|
committer | Mathias Preiner <mathias.preiner@gmail.com> | 2018-09-22 16:30:59 -0700 |
commit | ed8d326cbdec820d347d8b4b5ee7b23c3367d169 (patch) | |
tree | f5cb0da35a74e1e1155849e97fc6c644072c054b /cmake/Toolchain-mingw64.cmake | |
parent | 4a96ecb64741a78b6e138c75fcd7155058658849 (diff) |
cmake: Add support for cross-compiling for Windows.
Diffstat (limited to 'cmake/Toolchain-mingw64.cmake')
-rw-r--r-- | cmake/Toolchain-mingw64.cmake | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cmake/Toolchain-mingw64.cmake b/cmake/Toolchain-mingw64.cmake new file mode 100644 index 000000000..85c0622ed --- /dev/null +++ b/cmake/Toolchain-mingw64.cmake @@ -0,0 +1,23 @@ +# Toolchain file for building for Windows from Ubuntu. +# +# Use: cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake + +SET(CMAKE_SYSTEM_NAME Windows) + +set(TOOLCHAIN_PREFIX x86_64-w64-mingw32) + +SET(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) +SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) +SET(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres) + +# Set target environment path +SET(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX}) + +# Adjust the default behaviour of the find_XXX() commands: +# search headers and libraries in the target environment, search +# programs in the host environment +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) + +set(CVC4_WINDOWS_BUILD TRUE) |