Makefiles: Add Objective C/C++ compilations to compile_commands.json

Fixes: #20634
This commit is contained in:
Brad King
2020-04-27 08:42:27 -04:00
parent 98aa628f0b
commit c4d09fdc6d

View File

@@ -666,8 +666,9 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
// At the moment, it is assumed that C, C++, Fortran, and CUDA have both
// assembly and preprocessor capabilities. The same is true for the
// ability to export compile commands
bool lang_has_preprocessor = ((lang == "C") || (lang == "CXX") ||
(lang == "Fortran") || (lang == "CUDA"));
bool lang_has_preprocessor =
((lang == "C") || (lang == "CXX") || (lang == "OBJC") ||
(lang == "OBJCXX") || (lang == "Fortran") || (lang == "CUDA"));
bool const lang_has_assembly = lang_has_preprocessor;
bool const lang_can_export_cmds = lang_has_preprocessor;