Swift/Ninja: compile_commands.json mixes path-separators on Windows
The entries follow this format:
{
"directory": "C:/forward/slashes/",
"command": "C:\\escaped\\back\\slashes\\swiftc.exe",
"file": "C:\\escaped\\back\\slashes\\filename.swift",
"output": "forward/slashes/filename.swift.obj"
}
I believe all should probably be escaped back slashes, clang seems to have Windows specific parsing logic here: https://github.com/llvm/llvm-project/blob/bb8f2585c6eab263916757435d71df16d92de4a8/clang/lib/Tooling/JSONCompilationDatabase.cpp#L135. I'm not totally sure what various tools expect/support, but mixed path separators does seem like a bug.
Relevant code:
https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmGlobalNinjaGenerator.cxx#L1218
https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmNinjaTargetGenerator.cxx#L2356-2357