Skip to content

deps: Strengthen optional dependency guards and fallback implementations#191

Merged
kcenon merged 6 commits into
mainfrom
feature/190-strengthen-optional-dependency-guards
Dec 26, 2025
Merged

deps: Strengthen optional dependency guards and fallback implementations#191
kcenon merged 6 commits into
mainfrom
feature/190-strengthen-optional-dependency-guards

Conversation

@kcenon

@kcenon kcenon commented Dec 26, 2025

Copy link
Copy Markdown
Owner

Summary

  • Add static constexpr bool is_available to all optional components for compile-time detection
  • Add KCENON_WITH_MONITORING_SYSTEM macro support in feature_flags.h
  • Add has_monitoring_system() helper function for runtime detection
  • Add CMake isolated preset for testing fallback implementations
  • Add verify_isolated_build.sh script for verification
  • Update README with optional dependency matrix documentation

Changes

feature_flags.h

  • Added KCENON_WITH_MONITORING_SYSTEM macro definition
  • Added has_monitoring_system() constexpr helper function

Transport Classes (http_transport.h, websocket_transport.h)

  • Added static constexpr bool is_available = true to full implementations
  • Added static constexpr bool is_available = false to stub implementations

message_bus_collector.h

  • Added static constexpr bool is_available = true to full implementation
  • Added static constexpr bool is_available = false to stub implementation

CMakePresets.json

  • Added isolated configure preset with KCENON_WITH_NETWORK_SYSTEM=OFF and KCENON_WITH_MONITORING_SYSTEM=OFF
  • Added corresponding build and test presets

scripts/verify_isolated_build.sh

  • New script to verify isolated build works correctly
  • Supports --clean and --skip-tests options

README.md

  • Added KCENON_WITH_MONITORING_SYSTEM to build options table
  • Added "Optional Dependency Matrix" section
  • Added "Isolated Build" section with usage instructions
  • Added code examples for is_available usage

Test plan

  • Verify existing tests pass with full dependencies
  • Verify isolated build compiles successfully (cmake --preset=isolated)
  • Verify tests pass in isolated mode (ctest --preset=isolated)
  • Verify is_available constexpr is accessible at compile time

Closes #190

- Add KCENON_WITH_MONITORING_SYSTEM macro definition with default value 0
- Add has_monitoring_system() constexpr helper function
- Consistent with existing KCENON_WITH_NETWORK_SYSTEM pattern

Refs #190
- Add static constexpr bool is_available to http_transport
- Add static constexpr bool is_available to websocket_transport
- is_available = true when KCENON_WITH_NETWORK_SYSTEM is enabled
- is_available = false for stub implementations
- Enables compile-time detection of transport availability

Refs #190
- Add static constexpr bool is_available to message_bus_collector
- is_available = true when KCENON_WITH_MONITORING_SYSTEM is enabled
- is_available = false for stub implementation
- Enables compile-time detection of monitoring availability

Refs #190
- Add 'isolated' configure preset with all optional deps disabled
- KCENON_WITH_NETWORK_SYSTEM=OFF
- KCENON_WITH_MONITORING_SYSTEM=OFF
- Add corresponding build and test presets
- Enables verification that fallback implementations work correctly

Refs #190
- Add script to verify isolated build works correctly
- Configures and builds with all optional deps disabled
- Runs tests to verify fallback implementations
- Supports --clean and --skip-tests options

Refs #190
- Add KCENON_WITH_MONITORING_SYSTEM to build options table
- Add Optional Dependency Matrix section with fallback behaviors
- Document is_available constexpr usage with code examples
- Add Isolated Build section with preset usage instructions
- Reference verify_isolated_build.sh script

Refs #190
@kcenon kcenon merged commit 4b2a178 into main Dec 26, 2025
11 checks passed
@kcenon kcenon deleted the feature/190-strengthen-optional-dependency-guards branch December 26, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deps: Strengthen optional dependency guards and fallback implementations

1 participant