-
Notifications
You must be signed in to change notification settings - Fork 11
feat: C++20 modules support #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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