diff options
author | Tim Gallagher <tim.gallagher@gatech.edu> | 2014-11-05 18:37:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-11-05 19:50:16 (GMT) |
commit | 0842b08463d14d6c7e27dcb4cda278805cce6e5f (patch) | |
tree | 2698098fe885d9ca3f9bfd4edc7332267f304b68 /Source/cmMakefileTargetGenerator.cxx | |
parent | d5a373a10d530c797a00b3f7b815fa68cca24510 (diff) | |
download | CMake-0842b08463d14d6c7e27dcb4cda278805cce6e5f.zip CMake-0842b08463d14d6c7e27dcb4cda278805cce6e5f.tar.gz CMake-0842b08463d14d6c7e27dcb4cda278805cce6e5f.tar.bz2 |
Makefile: Refactor checks for lang-specific targets and export compile cmds
The checks are now split into languages that are able to generate
assembly listings, languages that are able to generate preprocessed
listings, and languages that are able to export the compile commands.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 1adcb8a..a1f4141 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -702,7 +702,13 @@ cmMakefileTargetGenerator vars.Defines = definesString.c_str(); - bool lang_is_c_or_cxx = ((lang == "C") || (lang == "CXX")); + // At the moment, it is assumed that C and C++ 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")); + bool const lang_has_assembly = lang_has_preprocessor; + bool const lang_can_export_cmds = lang_has_preprocessor; // Construct the compile rules. { @@ -715,7 +721,7 @@ cmMakefileTargetGenerator cmSystemTools::ExpandListArgument(compileRule, compileCommands); if (this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS") && - lang_is_c_or_cxx && compileCommands.size() == 1) + lang_can_export_cmds && compileCommands.size() == 1) { std::string compileCommand = compileCommands[0]; this->LocalGenerator->ExpandRuleVariables(compileCommand, vars); @@ -771,9 +777,9 @@ cmMakefileTargetGenerator } } - bool do_preprocess_rules = lang_is_c_or_cxx && + bool do_preprocess_rules = lang_has_preprocessor && this->LocalGenerator->GetCreatePreprocessedSourceRules(); - bool do_assembly_rules = lang_is_c_or_cxx && + bool do_assembly_rules = lang_has_assembly && this->LocalGenerator->GetCreateAssemblySourceRules(); if(do_preprocess_rules || do_assembly_rules) { |