Cross-Platform C++ Development Infrastructure
A deterministic, self-contained development and automation pipeline designed to enforce 1:1 build parity between Linux and Windows, eliminate environment drift, and ensure seamless IDE integration.
🛠️ Core Technology Stack & Architecture
- Language: Modern C++ (utilizing features requiring C++17/C++20 frameworks).
- Build System & Presets: CMake structured with
CMakePresets.jsonto handle multi-platform toolchains natively. - UI Framework: Custom-built Qt6 libraries stripped of legacy dependencies and optimized for minimal binary footprint.
- Orchestration Wrapper: A unified Python script (
build.py) acting as the central gatekeeper for environment management, compiling, testing, and deployment.
🐋 Containerization & Toolchain Isolation
To achieve deterministic compilation and isolate dependencies from the host OS, the environment utilizes a specialized Docker architecture:
- Single Unified Image: Houses 5 distinct cross-compilation toolchains alongside 5 custom-built Qt6 library configurations.
- Host Elimination: Prevents local configuration contamination ("works on my machine" syndrome).
- Wine Integration for MSVC: Runs the Microsoft Visual C++ (MSVC) compiler directly inside Wine on Linux, removing the requirement to pivot to a heavyweight Windows Virtual Machine or remote server for testing Windows targets.
🔄 The Recursive build.py Pipeline
The Python orchestrator relies on a highly flexible argument separator design (--) to pass commands recursively down
through abstraction layers.
Execution Chain Workflow:
- Host Level: Called to invoke the containerized environment.
- Container Level: Docker launches, automatically calling the script within the isolated image while stripping the outer command layer.
- Translation Level: Wine initializes to handle Windows binaries under Linux, executing the native compilation step.
🎛️ Dynamic Environment Merging & Custom Presets
Because CMake 4.0 dropped support for passing preset environment variables natively via standalone script mode (-P),
the environment data is handled securely at the Python level:
- The Sourcing Matrix:
build.pyprogrammatically parses and merges data from three distinct configuration layers:build.ini: The master infrastructural variables.CMakePresets.json: Extracts the active preset's"environment"dictionary blocks.user.ini: Local developer configurations (such as local parallel thread limits or local path updates) mapped automatically based on the system's hostname (mimickingCMakeUserPresets.json).
- Dependency Resolution (MinGW CTest): When running Linux-native MinGW cross-compiled tests under Wine,
build.pyprogrammatically invokeswinepath -wto convert Linux directory paths into Windows syntax and injects them seamlessly into theWINEPATHenvironment variable. This ensures CTest can dynamically locate the correct custom Qt6 DLLs without breaking.
💻 Native IDE Synchronization (CLion Feature Integration)
The architecture eliminates the need to pollute the host OS or force developers to pre-source shell scripts before launching the IDE.
- On-Demand Environment Scripts:
build.pyautomatically exports a localized environment wrapper shell script. - Vendor-Specific JSON Binding: The exported toolchain names and script parameters are configured directly inside
CMakePresets.json. - 1:1 Compilation Parity: When a developer switches presets inside CLion's UI dropdown, CLion automatically reads the native configuration feature and executes the environment script behind the scenes. This guarantees perfect synchronization, autocomplete tracking, and real-time step-through debugging identical to the headless command-line CI/CD pipeline.
🚀 DevOps Automation & Quality Control
The pipeline functions as a rigid quality fortress, wrapping every build in automated testing and packaging protocols:
- Quality Gates: Automatically runs CTest execution and evaluates code coverage to output an HTML coverage report.
- Documentation: Automatically processes code via Doxygen on the fly to generate up-to-date manual frameworks.
- Deployment Channels: Packages the final binary deliverables and uploads them directly to self-hosted APT ( Linux) and Winget (Windows) repositories.