---
id: TASK-39
title: Link compile_commands.json for sysbuild projects
status: Done
assignee:
  - mrbya
created_date: '2026-03-05 16:40'
labels: []
dependencies: []
priority: medium
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Ensure compile_commands.json is linked to the build root for sysbuild builds, using the project’s app image and respecting profiles, so tooling always targets the correct compilation database.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 Sysbuild project builds link compile_commands.json into the build root.
- [ ] #2 The linked file comes from the project app image whose name matches the project_root directory name, even when multiple images are built.
- [ ] #3 For sysbuild projects with configured profiles, the link targets the project app image’s compile_commands.json in the correct profile directory.
- [ ] #4 Commands that do not resolve a sysbuild app image do not create or update the link.
- [ ] #5 Tests cover sysbuild linking behavior, including app-image selection and profile-aware linking.
- [ ] #6 Docs and CHANGELOG are updated if user-visible behavior changes.
<!-- AC:END -->
