diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2022-10-28 11:42:24 -0400 |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2022-10-28 13:54:43 -0400 |
commit | 887a8874c343e88ccfca4098584cea91ab8138e6 (patch) | |
tree | 1deb703c267fa45069c16d30cafbb706a5970408 /Source/cmGlobalUnixMakefileGenerator3.cxx | |
parent | 5e1c5425651b215dbee89e46e146e87d10df268f (diff) | |
download | cmake-887a8874c343e88ccfca4098584cea91ab8138e6.tar.gz |
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/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 21aa89c3cd..bf9e40ed2a 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -143,7 +143,7 @@ void cmGlobalUnixMakefileGenerator3::Generate() void cmGlobalUnixMakefileGenerator3::AddCXXCompileCommand( const std::string& sourceFile, const std::string& workingDirectory, - const std::string& compileCommand) + const std::string& compileCommand, const std::string& objPath) { if (!this->CommandDatabase) { std::string commandDatabaseName = @@ -164,7 +164,9 @@ void cmGlobalUnixMakefileGenerator3::AddCXXCompileCommand( << "\",\n" << R"( "file": ")" << cmGlobalGenerator::EscapeJSON(sourceFile) - << "\"\n}"; + << "\",\n" + << R"( "output": ")" + << cmGlobalGenerator::EscapeJSON(objPath) << "\"\n}"; } void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2() |