I’m generating a compilation database file compilation_commands.json by setting set(CMAKE_EXPORT_COMPILE_COMMANDS ON) in the cmake.
The compilation_commands.json file was generating for both GCC & IAR toolchains. Now the issue is for IAR the included paths generating with double backward slashes. See below for example.
Actually, I’m parsing this JSON file to the cppcheck tool for static analysis. This tool is ignoring the included paths (-I…\…\product\application -I…\…\shared\common -I…\…\shared) with double backslashes.
Is there a way in CMake to generate compilation_commands.json with included paths single forward slashes?
It seems like a bug that it transforms in one case but not the other. Investigation as to the difference would be needed. Could you create a small, simple example project that shows the difference when configured with each toolchain?