A Linux C++ developer shares hard-won lessons from setting up fast Windows CI builds on GitHub Actions. Key findings: Ninja is pre-installed in GitHub Actions Windows images (no extra install step needed), the ilammy/msvc-dev-cmd@v1 action sets up the MSVC environment correctly so CMake can find cl.exe, and CMAKE_CXX_FLAGS values with spaces require nested quotes on the command line. Following these steps reduced Windows build times from ~4 minutes to ~90 seconds while also enabling stricter compiler warnings.
Table of contents
How it started: Copy link Link copied!First attempt: --parallel Copy link Link copied!Second attempt: ninja Copy link Link copied!Third attempt: Add CMAKE_CXX_FLAGS Copy link Link copied!Fourth attempt: Back to Ninja again Copy link Link copied!Result: Around 90 seconds for Windows builds instead of 4 minutes, and better warnings. Copy link Link copied!Sort: