[CI] Use ccache for Windows builds (#8332)
authorAndres Noetzli <andres.noetzli@gmail.com>
Thu, 17 Mar 2022 16:55:23 +0000 (09:55 -0700)
committerGitHub <noreply@github.com>
Thu, 17 Mar 2022 16:55:23 +0000 (16:55 +0000)
On Ubuntu, there are ccache symlinks for `x86_64-w64-mingw32-gcc` and `x86_64-w64-mingw32-g++` but not the POSIX-specific variants. Furthermore, not all Linux distributions add the `-posix` suffix for that variant. Thus, this commit changes our Toolchain file to use the more generic `x86_64-w64-mingw32-gcc` and `x86_64-w64-mingw32-g++` compiler names and changes our CI to use the POSIX variant by default.

.github/actions/install-dependencies/action.yml
cmake/Toolchain-mingw64.cmake

index 3c06132de649b1381ec9e1a4651a6ed2f83f3128..1dc3a1ad322e672499c71f34a996191117e1b7ad 100644 (file)
@@ -52,6 +52,11 @@ runs:
         sudo apt-get update
         sudo apt-get install -y \
           mingw-w64
+
+        # cvc5 requires the POSIX version of MinGW to implement the time limit
+        # using threads
+        sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
+        sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
         echo "::endgroup::"
 
     # Note: macOS comes with a libedit; it does not need to brew-installed
index f3b6be9dad9752124b1ae374d11f1fb2c00dc706..c4c2473cf9bb6b090b64cfed0ae248dabd574067 100644 (file)
@@ -19,8 +19,8 @@ SET(CMAKE_SYSTEM_NAME Windows)
 
 set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
 
-SET(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc-posix)
-SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++-posix)
+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