cmExtraSublimeTextGenerator: Use GetTargetCompileFlags

Replace some custom code with equivalent code from the framework.

This also fixes some fixmes left in the custom code.
This commit is contained in:
Tobias Hunger 2016-06-10 18:09:13 +02:00 committed by Brad King
parent 3c488ce899
commit 802b36fb62
1 changed files with 3 additions and 24 deletions

View File

@ -314,27 +314,14 @@ std::string cmExtraSublimeTextGenerator::ComputeFlagsForObject(
cmSourceFile* source, cmLocalGenerator* lg, cmGeneratorTarget* gtgt) cmSourceFile* source, cmLocalGenerator* lg, cmGeneratorTarget* gtgt)
{ {
std::string flags; std::string flags;
cmMakefile* makefile = lg->GetMakefile();
std::string language = source->GetLanguage(); std::string language = source->GetLanguage();
if (language.empty()) { if (language.empty()) {
language = "C"; language = "C";
} }
const std::string& config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); std::string const& config =
// Add language-specific flags. lg->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
lg->AddLanguageFlags(flags, language, config);
lg->AddArchitectureFlags(flags, gtgt, language, config); lg->GetTargetCompileFlags(gtgt, config, language, flags);
// TODO: Fortran support.
// // Fortran-specific flags computed for this target.
// if(*l == "Fortran")
// {
// this->AddFortranFlags(flags);
// }
// Add shared-library flags if needed.
lg->AddCMP0018Flags(flags, gtgt, language, config);
// Add include directory flags. // Add include directory flags.
{ {
@ -345,17 +332,9 @@ std::string cmExtraSublimeTextGenerator::ComputeFlagsForObject(
lg->AppendFlags(flags, includeFlags); lg->AppendFlags(flags, includeFlags);
} }
// Append old-style preprocessor definition flags.
lg->AppendFlags(flags, makefile->GetDefineFlags());
// Add target-specific flags.
lg->AddCompileOptions(flags, gtgt, language, config);
// Add source file specific flags. // Add source file specific flags.
lg->AppendFlags(flags, source->GetProperty("COMPILE_FLAGS")); lg->AppendFlags(flags, source->GetProperty("COMPILE_FLAGS"));
// TODO: Handle Apple frameworks.
return flags; return flags;
} }