1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-License-Identifier: MIT OR Apache-2.0
// Copyright (c) 2026 Max-Mend
// This file is part of smidr: https://github.com/Max-Mend/smidr
//! Generates `compile_commands.json`, the de facto standard format
//! consumed by `clangd` and other C/C++ language servers for accurate
//! code completion and diagnostics.
//!
//! This module only knows how to serialize a list of entries to disk —
//! building that list from the actual compile commands run during a
//! build is [`crate::builder`]'s job (not yet wired up; see the crate's
//! roadmap).
use crateResult;
use Serialize;
use Path;
/// One entry in `compile_commands.json`, matching the format's
/// conventional field names.
/// Serialize `entries` as pretty-printed JSON and write them to
/// `out_path` (conventionally `compile_commands.json` in the project
/// root).