Skip to content

Add native CMake context generation support - #529

Merged
brondani merged 2 commits into
mainfrom
add-native-cmake-context
Aug 21, 2026
Merged

brondani merged 2 commits into
mainfrom
add-native-cmake-context

Conversation

@brondani

Copy link
Copy Markdown
Collaborator

Fixes

Changes

  • Parse and validate native CMake context metadata from cbuild files.
  • Generate context-level CMake wrappers for configuring native projects, exporting compilation databases, and invoking optional build targets.
  • Integrate native CMake images and targets into the solution-level CMake orchestration.
  • Correct per-context West target selection when mixed context types are present.
  • Add unit and golden-file coverage for native CMake solutions.

Checklist

  • 🤖 This change is covered by unit tests (if applicable).
  • 🤹 Manual testing has been performed (if necessary).
  • 🛡️ Security impacts have been considered (if relevant).
  • 📖 Documentation updates are complete (if required).
  • 🧠 Third-party dependencies and TPIP updated (if required).

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@brondani
brondani force-pushed the add-native-cmake-context branch from 4595c47 to fbdf629 Compare August 20, 2026 14:01
Parse and validate native CMake metadata, generate context-specific build
wrappers, and integrate native targets and image outputs into super builds.

Add fixtures and coverage for default and explicit native CMake settings.
@brondani
brondani force-pushed the add-native-cmake-context branch from fbdf629 to f2293ec Compare August 20, 2026 14:10
@qltysh

qltysh Bot commented Aug 20, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

⬇️ Merging this pull request will decrease total coverage on main by 0.1%.

Modified Files with Diff Coverage (4)

RatingFile% DiffUncovered Line #s
Coverage rating: B Coverage rating: C
pkg/maker/parser.go52.0%297-298, 300-301...
Coverage rating: A Coverage rating: A
pkg/maker/superlists.go91.7%44-46
Coverage rating: C Coverage rating: C
pkg/maker/maker.go100.0%
New file Coverage rating: A
pkg/maker/cmake.go95.5%22-24
Total86.3%
🤖 Increase coverage with AI coding...
In the `add-native-cmake-context` branch, add test coverage for this new code:

- `pkg/maker/cmake.go` -- Line 22-24
- `pkg/maker/parser.go` -- Lines 297-298, 300-301, 303-304, 307-308, 311-312, and 392-393
- `pkg/maker/superlists.go` -- Line 44-46

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Test Results

  5 files  ± 0   15 suites  ±0   9s ⏱️ +8s
118 tests + 5  118 ✅ + 5  0 💤 ±0  0 ❌ ±0 
590 runs  +25  587 ✅ +22  3 💤 +3  0 ❌ ±0 

Results for commit 9ce2755. ± Comparison against base commit c7369f5.

♻️ This comment has been updated with latest results.

@brondani
brondani requested a lite review from Copilot August 20, 2026 14:17

Copilot AI left a comment

Copy link
Copy Markdown

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 first-class handling of “native CMake” contexts by parsing cmake metadata from .cbuild.yml files, generating per-context CMake wrapper projects (for configure/build/comp-db), and integrating those contexts into the solution-level super-build orchestration (including mixed-context behavior).

Changes:

  • Parse, validate, and classify contexts as regular / West / native-CMake based on .cbuild-idx.yml + .cbuild.yml metadata.
  • Generate native-CMake context wrapper CMakeLists.txt with targets for database and cmake, and wire those into the super CMake build graph.
  • Add unit + golden-file coverage and new test fixtures for native-CMake solutions.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/data/solutions/cmake-support/solution.csolution.yml Adds a solution fixture containing native CMake projects/contexts.
test/data/solutions/cmake-support/solution.cbuild-idx.yml Adds cbuild index fixture marking contexts as cmake: true.
test/data/solutions/cmake-support/ref/explicit-core1.Debug+CM0/CMakeLists.txt Golden reference for generated native-CMake wrapper (minimal metadata).
test/data/solutions/cmake-support/ref/core0.Debug+CM0/CMakeLists.txt Golden reference for generated native-CMake wrapper (generator/config/target/images).
test/data/solutions/cmake-support/out/explicit-core1/CM0/Debug/explicit-core1.Debug+CM0.cbuild.yml Adds .cbuild.yml fixture including cmake: metadata.
test/data/solutions/cmake-support/out/core0/CM0/Debug/core0.Debug+CM0.cbuild.yml Adds .cbuild.yml fixture including richer cmake: metadata (images/target/configure).
pkg/maker/superlists.go Extends super-project generation to handle per-context West/native-CMake targets and native output images.
pkg/maker/parser.go Adds parsing structures and validation for native-CMake context metadata and classification flags.
pkg/maker/parser_test.go Adds unit tests validating parsing + classification of native-CMake contexts.
pkg/maker/maker.go Routes context generation to the new native-CMake CMakeLists generator.
pkg/maker/maker_test.go Adds a smoke test for native-CMake solution generation.
pkg/maker/cmake.go Introduces native-CMake context wrapper CMakeLists.txt generator.
pkg/maker/cmake_test.go Adds tests asserting generated native-CMake wrappers and super-project wiring.
cmd/cbuild2cmake/commands/root_test.go Adds golden-file integration test for the native-CMake solution scenario.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/maker/superlists.go
Comment thread pkg/maker/superlists.go Outdated
Comment thread pkg/maker/parser.go Outdated
@brondani
brondani marked this pull request as ready for review August 20, 2026 15:28
@brondani
brondani requested a review from edriouk August 20, 2026 15:29

@edriouk edriouk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brondani
brondani merged commit f8c8599 into main Aug 21, 2026
23 checks passed
@brondani
brondani deleted the add-native-cmake-context branch August 21, 2026 07:35
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.

3 participants