An example project to test and compare different CI (Continuous Integration) services building a C++ project on Linux, Mac, Windows with GCC, Clang (libc++ and libstdc++), MSVC and Clang-cl. It uses Vcpkg for installing dependencies.
Note: This tries to be a simple and robust CI setup that is a comprehensive introduction and is open for improvements. It does not use more advanced configurations like build matrices and instead tries to be a bit more specific (even if that means repetition).
- Linux:
- Clang 14 + libc++
- GCC 11 + libstdc++
- macOS:
- Clang 13 + libc++
- GCC 12 + libstdc++
- Windows:
- MSVC 2022
- Linux:
- Clang 14 + libc++
- Clang 14 + libstdc++
- GCC 11 + libstdc++
- macOS:
- Clang 13 + libc++
- Clang 13 + libstdc++
- GCC 12 + libstdc++
- Windows:
- MSVC 2022
- Clang-cl
- Linux:
- Clang 14 + libc++
- Clang 14 + libstdc++
- GCC 12 + libstdc++
- macOS:
- Clang 13 + libc++
- Clang 13 + libstdc++
- GCC 12 + libstdc++
- Windows:
- MSVC 2022
- Clang-cl
No longer supported, since they dropped their free Open Source support.
Note: This project contains example programs that serve no other purpose than being examples. The programs themselves don't make much sense on their own.
src/show_info
: Outputs a couple of strings describing the compiler and C++ standard library that were used to build the program.src/example
: Buildsexample
(just shows some simple output) andexample_tests
(an example for running tests).
The .ci
directory contains a couple of scripts for installing Vcpkg and building the project.
All CI services use these scripts to simplify their configurations.
install-vcpkg.sh
/install-vcpkg.ps1
: Download and install Vcpkg or update an already existing Vcpkg installation.build-project.sh
/build-project.ps1
: Build the project itself.build-project-with-clang-cl.ps1
: Used on Windows to build the project with Clang-cl.
- CMake
- Vcpkg to install dependencies:
- fmtlib
- Catch2 + FakeIt
Where possible all programs are build using Address Sanitizer.
Note: Clang-cl does not support Address Sanitizer in Debug
mode. Build with RelWithDebInfo
instead.
Output depends on compiler and C++ standard library.
GCC and libstdc++:
__cplusplus: 202002
__GNUC__: 11
_GLIBCXX_RELEASE: 11
Clang and libc++:
__cplusplus: 202002
__clang_version__: 14.0.5
_LIBCPP_VERSION: 14000
Clang and libstdc++:
__cplusplus: 202002
__clang_version__: 14.0.5
_GLIBCXX_RELEASE: 11
MSVC:
__cplusplus: 199711
_MSC_VER: 1932
Clang-cl:
__cplusplus: 202002
_MSC_VER: 1932
__clang_version__: 13.0.1
Everything seems to be working.
Randomness seeded to: 1486164745
===============================================================================
All tests passed (16 assertions in 3 test cases)
The CI VMs or Docker images come with already pre-installed software.