Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds C++20 modules support to the SIO library, enabling modern C++ module-based compilation when SIO_ENABLE_CXX_MODULES=ON and using C++20 or newer. The implementation focuses on two main areas: converting translation-unit-local entities to have external linkage by changing from static constexpr to inline constexpr, and adding CMake infrastructure to build and install module interface files.
- Changed constant definitions from
static constexprtoinline constexprfor C++20 module compatibility - Added CMake module support with compiler/version/generator checks
- Created module interface file (
sio_module.ixx) to export SIO types and APIs
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| source/sio_module.ixx | New module interface file that declares and exports SIO types, constants, and classes for C++20 module consumers |
| source/include/sio/definitions.h | Updated constant declarations from static constexpr to inline constexpr to ensure external linkage in modules |
| source/include/sio/memcpy.h | Updated sizeof_helper template members from static constexpr to inline static constexpr for module compatibility |
| source/CMakeLists.txt | Added conditional installation logic to install module files when SIO_ENABLE_CXX_MODULES is enabled |
| cmake/SIOModules.cmake | New CMake module providing functions and validation for C++20 module support (CMake 3.29+, GCC 14+, Clang 18+, Ninja generator) |
| CMakeLists.txt | Includes SIOModules.cmake and conditionally installs builtin ZLIB when modules are enabled |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4a2a337 to
43c3778
Compare
tmadlener
left a comment
There was a problem hiding this comment.
Looks good to me, but I have no easy way to test this in depth at the moment. Similar to the one in podio, I would make a new tag first and then merge this afterwards.
Co-authored-by: Thomas Madlener <thomas.madlener@desy.de>
This PR adds C++20 modules support (see also AIDASoft/podio#907). This mainly involved two things:
static constexprtoinline constexpr,SIO_ENABLE_CXX_MODULES=ON(andCMAKE_CXX_STANDARD=20or newer).BEGINRELEASENOTES
ENDRELEASENOTES