Incorrect compile_commands.json is generated by "NMake Makefiles" generator
Each command
field in compile_commands.json
contains pairs of @<<\n
and \n<<
inside a string literal:
"command": "C:\\PROGRA~2\\MICROS~1.0\\VC\\bin\\cl.exe @<<
/nologo (...)
<<",
It's not allowed as JSON string literals cannot contain control characters like \n
(see specs at http://json.org)
This is of course due to
# for nmake make long command lines are redirected to a file
# with the following syntax, see Windows-bcc32.cmake for use
if(CMAKE_GENERATOR MATCHES "NMake")
set(CMAKE_START_TEMP_FILE "@<<\n")
set(CMAKE_END_TEMP_FILE "\n<<")
endif()
But I think it should be filtered out while generating compile_commands.json