Skip to content

Commit ae9cf7d

Browse files
Pierre-Luc GagnéCopilot
andcommitted
fix: resolve Clang and MSVC CI build failures
Clang (tests-clang): - Switch from clang-15 to clang-18 (available in Ubuntu noble's standard repos — no extra PPA needed) - Remove g++-15 install from Clang job: mixing clang-15 with GCC 15's stdlib caused std::ranges::empty_view concept resolution failures; clang-18 + default GCC 14 stdlib is a well-tested combination MSVC (tests-msvc) and all compilers: - Add add_compile_definitions(BOOST_UT_DISABLE_MODULE) in tests/CMakeLists.txt Boost.UT v2.1.0 unconditionally emits 'export module boost.ut' when __cpp_modules is defined, causing fatal error C3378 under MSVC (/std:c++latest). Disabling module mode forces header-only inclusion which works with all three compilers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7af4bbf commit ae9cf7d

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,15 @@ jobs:
8888
| sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg > /dev/null
8989
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ noble main' \
9090
| sudo tee /etc/apt/sources.list.d/kitware.list
91-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
9291
sudo apt-get update -q
93-
sudo apt-get install -y cmake ninja-build clang-15 \
92+
sudo apt-get install -y cmake ninja-build clang-18 \
9493
libmysqlclient-dev pkg-config
9594
9695
- name: Configure
9796
run: cmake --preset release -DSKIP_DOCKER_MANAGEMENT=ON -DBUILD_INTEGRATION_TESTS=OFF -DBUILD_EXAMPLES=OFF
9897
env:
99-
CXX: clang++-15
100-
CC: clang-15
98+
CXX: clang++-18
99+
CC: clang-18
101100

102101
- name: Build
103102
run: cmake --build build -j4

tests/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ if(NOT TARGET Boost::ut)
1414
FetchContent_MakeAvailable(boost_ut)
1515
endif()
1616

17+
# Disable boost.ut's C++20 module mode — not all compilers/toolchains support
18+
# its module declaration (notably MSVC issues C3378 with /std:c++latest).
19+
add_compile_definitions(BOOST_UT_DISABLE_MODULE)
20+
1721
# Unit tests
1822
add_subdirectory(unit)
1923

0 commit comments

Comments
 (0)