mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-08 15:19:51 -05:00
cmCommonTargetGenerator: Adopt GetDefines method
Move the member up from cmMakefileTargetGenerator so it can be re-used later by cmNinjaTargetGenerator.
This commit is contained in:
@@ -332,3 +332,29 @@ std::string cmCommonTargetGenerator::GetFlags(const std::string &l)
|
||||
}
|
||||
return i->second;
|
||||
}
|
||||
|
||||
std::string cmCommonTargetGenerator::GetDefines(const std::string &l)
|
||||
{
|
||||
ByLanguageMap::iterator i = this->DefinesByLanguage.find(l);
|
||||
if (i == this->DefinesByLanguage.end())
|
||||
{
|
||||
std::set<std::string> defines;
|
||||
const char *lang = l.c_str();
|
||||
// Add the export symbol definition for shared library objects.
|
||||
if(const char* exportMacro = this->Target->GetExportMacro())
|
||||
{
|
||||
this->LocalGenerator->AppendDefines(defines, exportMacro);
|
||||
}
|
||||
|
||||
// Add preprocessor definitions for this target and configuration.
|
||||
this->LocalGenerator->AddCompileDefinitions(defines, this->Target,
|
||||
this->LocalGenerator->GetConfigName(), l);
|
||||
|
||||
std::string definesString;
|
||||
this->LocalGenerator->JoinDefines(defines, definesString, lang);
|
||||
|
||||
ByLanguageMap::value_type entry(l, definesString);
|
||||
i = this->DefinesByLanguage.insert(entry).first;
|
||||
}
|
||||
return i->second;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user