Browse Source

Merge topic 'makefile-objc' into release-3.17

c4d09fdc6d Makefiles: Add Objective C/C++ compilations to compile_commands.json
98aa628f0b Makefiles: Scan Objective C/C++ preprocessor dependencies

Acked-by: Kitware Robot <[email protected]>
Merge-request: !4675
Brad King 5 years ago
parent
commit
9db6583531
2 changed files with 4 additions and 3 deletions
  1. 1 1
      Source/cmLocalUnixMakefileGenerator3.cxx
  2. 3 2
      Source/cmMakefileTargetGenerator.cxx

+ 1 - 1
Source/cmLocalUnixMakefileGenerator3.cxx

@@ -1472,7 +1472,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies(
     // Create the scanner for this language
     std::unique_ptr<cmDepends> scanner;
     if (lang == "C" || lang == "CXX" || lang == "RC" || lang == "ASM" ||
-        lang == "CUDA") {
+        lang == "OBJC" || lang == "OBJCXX" || lang == "CUDA") {
       // TODO: Handle RC (resource files) dependencies correctly.
       scanner = cm::make_unique<cmDependsC>(this, targetDir, lang, &validDeps);
     }

+ 3 - 2
Source/cmMakefileTargetGenerator.cxx

@@ -677,8 +677,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;