Browse Source

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

Fixes: #20634
Brad King 5 năm trước cách đây
mục cha
commit
c4d09fdc6d
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  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
   // 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;