summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2022-10-28 15:42:24 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2022-10-28 17:54:43 (GMT)
commit887a8874c343e88ccfca4098584cea91ab8138e6 (patch)
tree1deb703c267fa45069c16d30cafbb706a5970408 /Source/cmGlobalNinjaGenerator.cxx
parent5e1c5425651b215dbee89e46e146e87d10df268f (diff)
downloadCMake-887a8874c343e88ccfca4098584cea91ab8138e6.zip
CMake-887a8874c343e88ccfca4098584cea91ab8138e6.tar.gz
CMake-887a8874c343e88ccfca4098584cea91ab8138e6.tar.bz2
EXPORT_COMPILE_COMMANDS: add `output` field
Also write for all configurations from multi-config generators. This field was added in the Clang 5 documentation and not present in the Clang 4 documentation (sometime between Dec 2016 and Mar 2017 according to `web.archive.org`).
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 077de42..395372b 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1171,7 +1171,8 @@ void cmGlobalNinjaGenerator::AddAdditionalCleanFile(std::string fileName,
}
void cmGlobalNinjaGenerator::AddCXXCompileCommand(
- const std::string& commandLine, const std::string& sourceFile)
+ const std::string& commandLine, const std::string& sourceFile,
+ const std::string& objPath)
{
// Compute Ninja's build file path.
std::string buildFileDir =
@@ -1205,7 +1206,9 @@ void cmGlobalNinjaGenerator::AddCXXCompileCommand(
<< R"( "command": ")"
<< cmGlobalGenerator::EscapeJSON(commandLine) << "\",\n"
<< R"( "file": ")"
- << cmGlobalGenerator::EscapeJSON(sourceFileName) << "\"\n"
+ << cmGlobalGenerator::EscapeJSON(sourceFileName) << "\",\n"
+ << R"( "output": ")"
+ << cmGlobalGenerator::EscapeJSON(objPath) << "\"\n"
<< "}";
/* clang-format on */
}