Merge topic 'remove-AddCompileDefinitions'

8f076acdb0 cmLocalGenerator: Remove AddCompileDefinitions method

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2470
This commit is contained in:
Brad King
2018-10-11 11:43:57 +00:00
committed by Kitware Robot
6 changed files with 9 additions and 31 deletions
+1 -6
View File
@@ -384,13 +384,8 @@ std::string cmExtraSublimeTextGenerator::ComputeDefines(
cmGeneratorExpressionInterpreter genexInterpreter(lg, config, target,
language);
// Add the export symbol definition for shared library objects.
if (const char* exportMacro = target->GetExportMacro()) {
lg->AppendDefines(defines, exportMacro);
}
// Add preprocessor definitions for this target and configuration.
lg->AddCompileDefinitions(defines, target, config, language);
lg->GetTargetDefines(target, config, language, defines);
const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS");
if (const char* compile_defs = source->GetProperty(COMPILE_DEFINITIONS)) {
lg->AppendDefines(
+2 -7
View File
@@ -267,14 +267,9 @@ std::string cmGhsMultiTargetGenerator::GetDefines(const std::string& language,
if (i == this->DefinesByLanguage.end()) {
std::set<std::string> defines;
const char* lang = language.c_str();
// Add the export symbol definition for shared library objects.
if (const char* exportMacro = this->GeneratorTarget->GetExportMacro()) {
this->LocalGenerator->AppendDefines(defines, exportMacro);
}
// Add preprocessor definitions for this target and configuration.
this->LocalGenerator->AddCompileDefinitions(defines, this->GeneratorTarget,
config, language);
this->LocalGenerator->GetTargetDefines(this->GeneratorTarget, config,
language, defines);
std::string definesString;
this->LocalGenerator->JoinDefines(defines, definesString, lang);
+3 -11
View File
@@ -804,16 +804,6 @@ std::string cmLocalGenerator::GetIncludeFlags(
return flags;
}
void cmLocalGenerator::AddCompileDefinitions(std::set<std::string>& defines,
cmGeneratorTarget const* target,
const std::string& config,
const std::string& lang) const
{
std::vector<std::string> targetDefines;
target->GetCompileDefinitions(targetDefines, config, lang);
this->AppendDefines(defines, targetDefines);
}
void cmLocalGenerator::AddCompileOptions(std::string& flags,
cmGeneratorTarget* target,
const std::string& lang,
@@ -1268,7 +1258,9 @@ void cmLocalGenerator::GetTargetDefines(cmGeneratorTarget const* target,
}
// Add preprocessor definitions for this target and configuration.
this->AddCompileDefinitions(defines, target, config, lang);
std::vector<std::string> targetDefines;
target->GetCompileDefinitions(targetDefines, config, lang);
this->AppendDefines(defines, targetDefines);
}
std::string cmLocalGenerator::GetTargetFortranFlags(
-4
View File
@@ -251,10 +251,6 @@ public:
bool appendAllImplicitDirs = false) const;
void AddCompileOptions(std::string& flags, cmGeneratorTarget* target,
const std::string& lang, const std::string& config);
void AddCompileDefinitions(std::set<std::string>& defines,
cmGeneratorTarget const* target,
const std::string& config,
const std::string& lang) const;
std::string GetProjectName() const;
+2 -2
View File
@@ -1819,8 +1819,8 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo(
// Build a list of preprocessor definitions for the target.
std::set<std::string> defines;
this->AddCompileDefinitions(defines, target, this->ConfigName,
implicitLang.first);
this->GetTargetDefines(target, this->ConfigName, implicitLang.first,
defines);
if (!defines.empty()) {
/* clang-format off */
cmakefileStream
+1 -1
View File
@@ -416,7 +416,7 @@ bool cmQtAutoGenInitializer::InitMoc()
auto GetCompileDefinitions =
[this, localGen](std::string const& cfg) -> std::string {
std::set<std::string> defines;
localGen->AddCompileDefinitions(defines, this->Target, cfg, "CXX");
localGen->GetTargetDefines(this->Target, cfg, "CXX", defines);
return cmJoin(defines, ";");
};