diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2016-06-10 16:04:58 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-06-17 18:49:38 (GMT) |
commit | 3c488ce89955d00785bb4637c87b960da6c55ec8 (patch) | |
tree | ab23337d74ad31f05734257251e8741f52ac126f /Source/cmLocalGenerator.cxx | |
parent | 5467e7945d46f5f8540a6e11933c9b6b584036a2 (diff) | |
download | CMake-3c488ce89955d00785bb4637c87b960da6c55ec8.zip CMake-3c488ce89955d00785bb4637c87b960da6c55ec8.tar.gz CMake-3c488ce89955d00785bb4637c87b960da6c55ec8.tar.bz2 |
cmLocalGenerator: Adopt target compile flag generation
Factor the flag generation out of cmCommonTargetGenerator::GetFlags
into a new cmLocalGenerator::GetTargetCompileFlags method.
This will allow it to be used without a target generator available.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index a0263e4..e2e7aa1 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1272,6 +1272,33 @@ void cmLocalGenerator::GetTargetFlags( } } +void cmLocalGenerator::GetTargetCompileFlags(cmGeneratorTarget* target, + std::string const& config, + std::string const& lang, + std::string& flags) +{ + cmMakefile* mf = this->GetMakefile(); + + // Add language-specific flags. + this->AddLanguageFlags(flags, lang, config); + + if (target->GetFeatureAsBool("INTERPROCEDURAL_OPTIMIZATION", config)) { + this->AppendFeatureOptions(flags, lang, "IPO"); + } + + this->AddArchitectureFlags(flags, target, lang, config); + + if (lang == "Fortran") { + this->AppendFlags(flags, this->GetTargetFortranFlags(target, config)); + } + + this->AddCMP0018Flags(flags, target, lang, config); + this->AddVisibilityPresetFlags(flags, target, lang); + this->AppendFlags(flags, mf->GetDefineFlags()); + this->AppendFlags(flags, this->GetFrameworkFlags(lang, config, target)); + this->AddCompileOptions(flags, target, lang, config); +} + static std::string GetFrameworkFlags(const std::string& lang, const std::string& config, cmGeneratorTarget* target) |