From 4e449aaf39ef7e60eb721d4f6887b35d9386ad4d Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Thu, 17 Mar 2022 09:55:23 -0700 Subject: [PATCH] [CI] Use ccache for Windows builds (#8332) 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 | 5 +++++ cmake/Toolchain-mingw64.cmake | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml index 3c06132de..1dc3a1ad3 100644 --- a/.github/actions/install-dependencies/action.yml +++ b/.github/actions/install-dependencies/action.yml @@ -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 diff --git a/cmake/Toolchain-mingw64.cmake b/cmake/Toolchain-mingw64.cmake index f3b6be9da..c4c2473cf 100644 --- a/cmake/Toolchain-mingw64.cmake +++ b/cmake/Toolchain-mingw64.cmake @@ -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 -- 2.30.2