I am trying to use the clangd vscode extension with cmake, but it isn't detecting my pch file, even though everything compiles just fine. I think this is because clangd isn't detecting the cmake_pch_arm64.hxx file generated by cmake. Because if I manually go and change the file extension from .hxx to .h and update the compile_commands.json file accordingly, everything works as expected. Additionally I get a warning from clangd in the cmake_pch_arm64.hxx file: #pragma system_header ignored in main file clang(-Wpragma-system-header-outside-header)
.
I am wondering if there is any way to configure cmake so that it stops using the .hxx extension for that file? If this is not supported by make, is there any other way to automatically change the file extension and compile_commands.json file every time I build the project?