Просмотр исходного кода

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

Fixes: #20634
Brad King 5 лет назад
Родитель
Сommit
c4d09fdc6d
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      Source/cmMakefileTargetGenerator.cxx

+ 3 - 2
Source/cmMakefileTargetGenerator.cxx

@@ -666,8 +666,9 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
   // At the moment, it is assumed that C, C++, Fortran, and CUDA have both
   // At the moment, it is assumed that C, C++, Fortran, and CUDA have both
   // assembly and preprocessor capabilities. The same is true for the
   // assembly and preprocessor capabilities. The same is true for the
   // ability to export compile commands
   // 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_has_assembly = lang_has_preprocessor;
   bool const lang_can_export_cmds = lang_has_preprocessor;
   bool const lang_can_export_cmds = lang_has_preprocessor;