build(cmake): always export compile_commands.json (CoolProp-2uw.7)#2789
Merged
Conversation
This was referenced Apr 26, 2026
Set CMAKE_EXPORT_COMPILE_COMMANDS ON unconditionally so any cmake configure produces compile_commands.json. Required for clang-tidy (Tier 2.1, 2.2), include-what-you-use (Tier 3.4), and editor LSP integrations. Verified locally with Ninja generator: 97 entries covering src/ produced without any explicit -DCMAKE_EXPORT_COMPILE_COMMANDS=ON flag. Adds dev/ci/README.md documenting the contributor invocation, including the Homebrew clang-tidy / Apple-SDK sysroot caveat for macOS contributors. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
34d37f3 to
65c8bd9
Compare
This was referenced Apr 26, 2026
ibell
added a commit
that referenced
this pull request
Apr 26, 2026
…2797) Tier 3.4 of the C++ code-quality epic. include-what-you-use is already wired into CMakeLists.txt via the COOLPROP_IWYU opt-in (and depends on compile_commands.json from CoolProp-2uw.7, which landed in #2789). This workflow runs the IWYU build on every PR and uploads the full report as a downloadable artifact. Warning-only: continue-on-error on the build step, if: always() on the upload, never fails a PR. IWYU output is high-noise and its suggestions need per-file judgment — the artifact gives contributors and AI agents the data without forcing a per-PR triage. Trigger model: PR + master push + weekly fallback + workflow_dispatch (matches the cadence the rest of the warning-only workflows use). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tier 2.3 of the C++ code-quality epic (
CoolProp-2uw). SetsCMAKE_EXPORT_COMPILE_COMMANDS ONunconditionally inCMakeLists.txtso any cmake configure producescompile_commands.jsonautomatically. Unblocks:CoolProp-2uw.5(clang-tidy-diff CI workflow)CoolProp-2uw.6(clang-tidy pre-commit hook)CoolProp-2uw.11(IWYU report job)CoolProp-2uw.13(safeclang-tidy --fixpasses)Plus editor LSP integrations (clangd, ccls).
Verification
Tested locally with the Ninja generator on macOS arm64:
cmake -G Ninja -B build_tidy -S .(no explicit export flag) producesbuild_tidy/compile_commands.jsonsrc/clang-tidy -p build_tidy src/CPstrings.cppruns and surfaces real.clang-tidywarnings (e.g.,readability-isolate-declaration,misc-include-cleaner)New:
dev/ci/README.mdDocuments the contributor build invocation. Includes a macOS sysroot caveat — the Homebrew
llvm@18/llvmpackages shipclang-tidybut don't see Apple's Xcode SDK by default. Workaround:```bash
SDK=$(xcrun --show-sdk-path)
clang-tidy -p build --extra-arg=--sysroot=$SDK src/...
```
CI runs on Ubuntu where this issue doesn't apply.
Test plan
cmake -B build -S .producesbuild/compile_commands.jsonwith no extra flagsclang-tidy -p build src/<file>.cppconsumes it without unresolved-include errors on LinuxRelated
CoolProp-2uw.1PR-only clang-format triggerCoolProp-2uw.3pre-commit clang-format hook🤖 Generated with Claude Code