EXPORT_COMPILE_COMMANDS: Append missing newline to compile_commands.json

This commit is contained in:
ClausKlein authored and Brad King committed 2025-02-18 16:01:24 -05:00
1 parent 92fb080ed6
commit ff119423b9
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -1236,7 +1236,7 @@ void cmGlobalNinjaGenerator::AddCXXCompileCommand(
void cmGlobalNinjaGenerator::CloseCompileCommandsStream()
{
if (this->CompileCommandsStream) {
*this->CompileCommandsStream << "\n]";
*this->CompileCommandsStream << "\n]\n";
this->CompileCommandsStream.reset();
}
}
@@ -20,7 +20,8 @@ set(expected_compile_commands
]*(/Tests/RunCMake/NinjaMultiConfig/main\.c|\\\\Tests\\\\RunCMake\\\\NinjaMultiConfig\\\\main\.c)",
"output": "(CMakeFiles/exe\.dir/Release/main\.c\.o|CMakeFiles\\\\exe\.dir\\\\Release\\\\main\.c\.(obj|o))"
}
]$]==])
]
$]==])
file(READ "${RunCMake_TEST_BINARY_DIR}/compile_commands.json" actual_compile_commands)
if(NOT actual_compile_commands MATCHES "${expected_compile_commands}")