# @\*.cppm.o.modmap files not found by clang-tidy?

**URL:** https://discourse.cmake.org/t/cppm-o-modmap-files-not-found-by-clang-tidy/15354
**Category:** Development
**Tags:** os:macos, gen:ninja
**Created:** [December 1, 2025, 8:16pm UTC](https://discourse.cmake.org/t/cppm-o-modmap-files-not-found-by-clang-tidy/15354 "2025-12-01T20:16:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [December 1, 2025, 8:16pm UTC](https://discourse.cmake.org/t/cppm-o-modmap-files-not-found-by-clang-tidy/15354/1 "2025-12-01T20:16:15Z")

</div>

is it a `clang-tidy` problem oder a wrong CMake generated `compile_commands.json`file?

```bash
Running clang-tidy for 4 files out of 4 in compilation database ...
[1/4][6.3s] /usr/local/Cellar/llvm/21.1.6/bin/clang-tidy -checks=-*,clang-* -p=/Users/clausklein/Workspace/cpp/boost-git/build /usr/local/Cellar/llvm/21.1.6/share/libc++/v1/std.compat.cppm
error: no such file or directory: '@CMakeFiles/__cmake_cxx26.dir/usr/local/Cellar/llvm/21.1.6/share/libc++/v1/std.compat.cppm.o.modmap' [clang-diagnostic-error]
/usr/local/Cellar/llvm/21.1.6/share/libc++/v1/std.compat.cppm:84:15: error: module 'std' not found [clang-diagnostic-error]
   84 | export import std;
      | ~~~~~~~^~~
2 errors generated.
Error while processing /usr/local/Cellar/llvm/21.1.6/share/libc++/v1/std.compat.cppm.
Found compiler error(s).

[2/4][6.6s] /usr/local/Cellar/llvm/21.1.6/bin/clang-tidy -checks=-*,clang-* -p=/Users/clausklein/Workspace/cpp/boost-git/build /usr/local/Cellar/llvm/21.1.6/share/libc++/v1/std.cppm
error: no such file or directory: '@CMakeFiles/__cmake_cxx26.dir/usr/local/Cellar/llvm/21.1.6/share/libc++/v1/std.cppm.o.modmap' [clang-diagnostic-error]
1 error generated.
Error while processing /usr/local/Cellar/llvm/21.1.6/share/libc++/v1/std.cppm.
Found compiler error(s).

[3/4][7.2s] /usr/local/Cellar/llvm/21.1.6/bin/clang-tidy -checks=-*,clang-* -p=/Users/clausklein/Workspace/cpp/boost-git/build /Users/clausklein/Workspace/cpp/boost-git/libs/type_index/modules/boost_type_index.cppm
[4/4][8.4s] /usr/local/Cellar/llvm/21.1.6/bin/clang-tidy -checks=-*,clang-* -p=/Users/clausklein/Workspace/cpp/boost-git/build /Users/clausklein/Workspace/cpp/boost-git/libs/any/modules/boost_any.cppm
bash-5.3$ find . -name '*.modmap'
./CMakeFiles/__cmake_cxx23.dir/usr/local/Cellar/llvm/21.1.6/share/libc++/v1/std.compat.cppm.o.modmap
./CMakeFiles/__cmake_cxx23.dir/usr/local/Cellar/llvm/21.1.6/share/libc++/v1/std.cppm.o.modmap
./libs/any/CMakeFiles/boost_any.dir/modules/boost_any.cppm.o.modmap
./libs/type_index/CMakeFiles/boost_type_index.dir/modules/boost_type_index.cppm.o.modmap
bash-5.3$ 

```

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [December 1, 2025, 8:19pm UTC](https://discourse.cmake.org/t/cppm-o-modmap-files-not-found-by-clang-tidy/15354/2 "2025-12-01T20:19:45Z")

</div>

[compile\_commands.json](https://discourse.cmake.org/uploads/short-url/aGlY0g0gFwDLqUlGxrkcMcBVN2R.json) (5.2 KB)

All file paths related to `cppm` files are relative? Is this right?

**bash-5.3$ `/usr/local/bin/cmake --version`**

**cmake version 4.2.0**

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [February 9, 2026, 3:54am UTC](https://discourse.cmake.org/t/cppm-o-modmap-files-not-found-by-clang-tidy/15354/3 "2026-02-09T03:54:16Z")

</div>

When running `clang-tidy` from the compilation database, the modmap files might not exist until a build is performed.
