summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-04-27 08:42:27 -0400
committerBrad King <brad.king@kitware.com>2020-04-28 07:03:07 -0400
commitc4d09fdc6d563570ef779244751e0088c83ea096 (patch)
tree7468b3211aabf580dab67daf72c3db841a234cc4
parent98aa628f0b1ceb04f0d0ac63fc96df57c7c5f76b (diff)
downloadcmake-c4d09fdc6d563570ef779244751e0088c83ea096.tar.gz
Makefiles: Add Objective C/C++ compilations to compile_commands.json
Fixes: #20634
-rw-r--r--Source/cmMakefileTargetGenerator.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index dd8a389cbe..9d08e073ed 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/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;