feat(modules): create C++20 module files for common_system Phase 2#268
Merged
Conversation
Add C++20 module files (.cppm) for common_system library as part of the module migration Phase 2. This provides an alternative module-based interface alongside the existing header-only approach. Module structure: - common.cppm: Primary module aggregator - utils.cppm: CircularBuffer, ObjectPool, source_location - error.cppm: Error codes and categories - result/*.cppm: Result<T> pattern implementation - concepts.cppm: C++20 type constraints - interfaces/*.cppm: IExecutor, ILogger, IThreadPool - config.cppm: Configuration utilities - di.cppm: Dependency injection - patterns.cppm: EventBus implementation - logging.cppm: Logging utilities CMake changes: - Update minimum version to 3.28 for module support - Add COMMON_BUILD_MODULES option (default: OFF) - Add common_system_modules target for module builds
Document the addition of C++20 module interface files in the unreleased section of the changelog.
Remove global CMAKE_CXX_SCAN_FOR_MODULES=ON which was causing CI failures by affecting CMake's internal try_compile() calls in FindThreads.cmake. The module scanning is already properly enabled via target-specific property (CXX_SCAN_FOR_MODULES ON) for the common_system_modules target inside the COMMON_BUILD_MODULES conditional block.
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
) * feat(modules): add C++20 module interface files (#265) Add C++20 module files (.cppm) for common_system library as part of the module migration Phase 2. This provides an alternative module-based interface alongside the existing header-only approach. Module structure: - common.cppm: Primary module aggregator - utils.cppm: CircularBuffer, ObjectPool, source_location - error.cppm: Error codes and categories - result/*.cppm: Result<T> pattern implementation - concepts.cppm: C++20 type constraints - interfaces/*.cppm: IExecutor, ILogger, IThreadPool - config.cppm: Configuration utilities - di.cppm: Dependency injection - patterns.cppm: EventBus implementation - logging.cppm: Logging utilities CMake changes: - Update minimum version to 3.28 for module support - Add COMMON_BUILD_MODULES option (default: OFF) - Add common_system_modules target for module builds * docs(changelog): add C++20 module files entry (#265) Document the addition of C++20 module interface files in the unreleased section of the changelog. * fix: remove global CMAKE_CXX_SCAN_FOR_MODULES setting Remove global CMAKE_CXX_SCAN_FOR_MODULES=ON which was causing CI failures by affecting CMake's internal try_compile() calls in FindThreads.cmake. The module scanning is already properly enabled via target-specific property (CXX_SCAN_FOR_MODULES ON) for the common_system_modules target inside the COMMON_BUILD_MODULES conditional block.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/modules/with partitioned architectureChanges
Module Structure
CMake Changes
COMMON_BUILD_MODULESoption (default: OFF)common_system_modulestarget with target-specific module scanningTest plan
cmake -DCOMMON_BUILD_MODULES=ON ..(optional feature, requires Phase 3)import kcenon.common;works correctly (Phase 3: Module Consumption Tests)Note: Module build testing (
COMMON_BUILD_MODULES=ON) is planned for Phase 3 (#266) which adds test examples. This PR focuses on creating the module interface files with backward-compatible default behavior.Related