From 04bf7486bc4249d4c6c7bca8f23dcc95b1cb8ac9 Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Sat, 12 Sep 2020 21:08:00 -0700 Subject: [PATCH] Added ubuntu mingw cross-compile CI instances to cmake GHA. --- .github/workflows/cmake.yml | 17 +++++++++++++++++ cmake/toolchain-mingw-i686.cmake | 15 +++++++++------ cmake/toolchain-mingw-x86_64.cmake | 15 +++++++++------ 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 220db70c..0a53a356 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -34,6 +34,8 @@ jobs: Ubuntu GCC S390X, Ubuntu GCC S390X DFLTCC, Ubuntu GCC S390X DFLTCC Compat, + Ubuntu MinGW i686, + Ubuntu MinGW x86_64, Ubuntu Clang, Ubuntu Clang Inflate Strict, Ubuntu Clang Inflate Allow Invalid Dist, @@ -237,6 +239,20 @@ jobs: ldflags: -static codecov: ubuntu_gcc_s390x + - name: Ubuntu MinGW i686 + os: ubuntu-latest + compiler: i686-w64-mingw32-gcc + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw-i686.cmake + packages: wine32 gcc-mingw-w64 + codecov: ubuntu_gcc_mingw_i686 + + - name: Ubuntu MinGW x86_64 + os: ubuntu-latest + compiler: x86_64-w64-mingw32-gcc + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw-x86_64.cmake + packages: wine-stable gcc-mingw-w64 + codecov: ubuntu_gcc_mingw_x86_64 + - name: Ubuntu Clang os: ubuntu-latest compiler: clang @@ -342,6 +358,7 @@ jobs: - name: Install packages (Ubuntu) if: runner.os == 'Linux' && matrix.packages run: | + sudo dpkg --add-architecture i386 # Required for wine32 sudo apt-get update sudo apt-get install -y ${{ matrix.packages }} diff --git a/cmake/toolchain-mingw-i686.cmake b/cmake/toolchain-mingw-i686.cmake index 5a93edff..588ec0ef 100644 --- a/cmake/toolchain-mingw-i686.cmake +++ b/cmake/toolchain-mingw-i686.cmake @@ -1,13 +1,16 @@ -SET(CMAKE_SYSTEM_NAME Windows) +set(CMAKE_SYSTEM_NAME Windows) -SET(CMAKE_C_COMPILER_TARGET i686) +set(CMAKE_C_COMPILER_TARGET i686) set(CMAKE_CXX_COMPILER_TARGET i686) -SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc) -SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) -SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres) +set(CMAKE_C_COMPILER i686-w64-mingw32-gcc) +set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) +set(CMAKE_RC_COMPILER i686-w64-mingw32-windres) -SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32) +set(CMAKE_CROSSCOMPILING TRUE) +set(CMAKE_CROSSCOMPILING_EMULATOR wine) + +set(CMAKE_FIND_ROOT_PATH /usr/i686-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) diff --git a/cmake/toolchain-mingw-x86_64.cmake b/cmake/toolchain-mingw-x86_64.cmake index 494d59fc..c778b722 100644 --- a/cmake/toolchain-mingw-x86_64.cmake +++ b/cmake/toolchain-mingw-x86_64.cmake @@ -1,13 +1,16 @@ -SET(CMAKE_SYSTEM_NAME Windows) +set(CMAKE_SYSTEM_NAME Windows) -SET(CMAKE_C_COMPILER_TARGET x86_64) +set(CMAKE_C_COMPILER_TARGET x86_64) set(CMAKE_CXX_COMPILER_TARGET x86_64) -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_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_FIND_ROOT_PATH /usr/x86_64-w64-mingw32) +set(CMAKE_CROSSCOMPILING TRUE) +set(CMAKE_CROSSCOMPILING_EMULATOR wine) + +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) -- 2.47.2