|
|
@@ -145,7 +145,6 @@ public:
|
|
|
std::vector<cmListFileBacktrace> CompileFeaturesBacktraces;
|
|
|
std::vector<std::string> CompileDefinitionsEntries;
|
|
|
std::vector<cmListFileBacktrace> CompileDefinitionsBacktraces;
|
|
|
- std::vector<TargetPropertyEntry*> CompileDefinitionsItems;
|
|
|
std::vector<TargetPropertyEntry*> SourceEntries;
|
|
|
std::vector<cmValueWithOrigin> LinkImplementationPropertyEntries;
|
|
|
|
|
|
@@ -174,7 +173,6 @@ cmTarget::cmTarget()
|
|
|
this->IsApple = false;
|
|
|
this->IsImportedTarget = false;
|
|
|
this->BuildInterfaceIncludesAppended = false;
|
|
|
- this->DebugCompileDefinitionsDone = false;
|
|
|
this->DebugSourcesDone = false;
|
|
|
this->LinkImplementationLanguageIsContextDependent = true;
|
|
|
}
|
|
|
@@ -417,14 +415,6 @@ void CreatePropertyGeneratorExpressions(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void cmTarget::Compute()
|
|
|
-{
|
|
|
- CreatePropertyGeneratorExpressions(
|
|
|
- this->Internal->CompileDefinitionsEntries,
|
|
|
- this->Internal->CompileDefinitionsBacktraces,
|
|
|
- this->Internal->CompileDefinitionsItems);
|
|
|
-}
|
|
|
-
|
|
|
//----------------------------------------------------------------------------
|
|
|
void cmTarget::AddUtility(const std::string& u, cmMakefile *makefile)
|
|
|
{
|
|
|
@@ -1328,6 +1318,16 @@ cmBacktraceRange cmTarget::GetCompileFeaturesBacktraces() const
|
|
|
return cmMakeRange(this->Internal->CompileFeaturesBacktraces);
|
|
|
}
|
|
|
|
|
|
+cmStringRange cmTarget::GetCompileDefinitionsEntries() const
|
|
|
+{
|
|
|
+ return cmMakeRange(this->Internal->CompileDefinitionsEntries);
|
|
|
+}
|
|
|
+
|
|
|
+cmBacktraceRange cmTarget::GetCompileDefinitionsBacktraces() const
|
|
|
+{
|
|
|
+ return cmMakeRange(this->Internal->CompileDefinitionsBacktraces);
|
|
|
+}
|
|
|
+
|
|
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
|
|
//----------------------------------------------------------------------------
|
|
|
void
|
|
|
@@ -1924,156 +1924,6 @@ void cmTarget::InsertCompileDefinition(std::string const& entry,
|
|
|
this->Internal->CompileDefinitionsBacktraces.push_back(bt);
|
|
|
}
|
|
|
|
|
|
-//----------------------------------------------------------------------------
|
|
|
-static void processCompileOptionsInternal(cmTarget const* tgt,
|
|
|
- const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
|
|
|
- std::vector<std::string> &options,
|
|
|
- UNORDERED_SET<std::string> &uniqueOptions,
|
|
|
- cmGeneratorExpressionDAGChecker *dagChecker,
|
|
|
- const std::string& config, bool debugOptions, const char *logName,
|
|
|
- std::string const& language)
|
|
|
-{
|
|
|
- cmMakefile *mf = tgt->GetMakefile();
|
|
|
-
|
|
|
- for (std::vector<cmTargetInternals::TargetPropertyEntry*>::const_iterator
|
|
|
- it = entries.begin(), end = entries.end(); it != end; ++it)
|
|
|
- {
|
|
|
- std::vector<std::string> entryOptions;
|
|
|
- cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
|
|
|
- config,
|
|
|
- false,
|
|
|
- tgt,
|
|
|
- dagChecker,
|
|
|
- language),
|
|
|
- entryOptions);
|
|
|
- std::string usedOptions;
|
|
|
- for(std::vector<std::string>::iterator
|
|
|
- li = entryOptions.begin(); li != entryOptions.end(); ++li)
|
|
|
- {
|
|
|
- std::string const& opt = *li;
|
|
|
-
|
|
|
- if(uniqueOptions.insert(opt).second)
|
|
|
- {
|
|
|
- options.push_back(opt);
|
|
|
- if (debugOptions)
|
|
|
- {
|
|
|
- usedOptions += " * " + opt + "\n";
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (!usedOptions.empty())
|
|
|
- {
|
|
|
- mf->GetCMakeInstance()->IssueMessage(cmake::LOG,
|
|
|
- std::string("Used compile ") + logName
|
|
|
- + std::string(" for target ")
|
|
|
- + tgt->GetName() + ":\n"
|
|
|
- + usedOptions, (*it)->ge->GetBacktrace());
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-//----------------------------------------------------------------------------
|
|
|
-static void processCompileDefinitions(cmTarget const* tgt,
|
|
|
- const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
|
|
|
- std::vector<std::string> &options,
|
|
|
- UNORDERED_SET<std::string> &uniqueOptions,
|
|
|
- cmGeneratorExpressionDAGChecker *dagChecker,
|
|
|
- const std::string& config, bool debugOptions,
|
|
|
- std::string const& language)
|
|
|
-{
|
|
|
- processCompileOptionsInternal(tgt, entries, options, uniqueOptions,
|
|
|
- dagChecker, config, debugOptions,
|
|
|
- "definitions", language);
|
|
|
-}
|
|
|
-
|
|
|
-//----------------------------------------------------------------------------
|
|
|
-void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
|
|
|
- const std::string& config,
|
|
|
- const std::string& language) const
|
|
|
-{
|
|
|
- UNORDERED_SET<std::string> uniqueOptions;
|
|
|
-
|
|
|
- cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
|
|
|
- "COMPILE_DEFINITIONS", 0, 0);
|
|
|
-
|
|
|
- std::vector<std::string> debugProperties;
|
|
|
- const char *debugProp =
|
|
|
- this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
|
|
|
- if (debugProp)
|
|
|
- {
|
|
|
- cmSystemTools::ExpandListArgument(debugProp, debugProperties);
|
|
|
- }
|
|
|
-
|
|
|
- bool debugDefines = !this->DebugCompileDefinitionsDone
|
|
|
- && std::find(debugProperties.begin(),
|
|
|
- debugProperties.end(),
|
|
|
- "COMPILE_DEFINITIONS")
|
|
|
- != debugProperties.end();
|
|
|
-
|
|
|
- if (this->Makefile->IsConfigured())
|
|
|
- {
|
|
|
- this->DebugCompileDefinitionsDone = true;
|
|
|
- }
|
|
|
-
|
|
|
- processCompileDefinitions(this,
|
|
|
- this->Internal->CompileDefinitionsItems,
|
|
|
- list,
|
|
|
- uniqueOptions,
|
|
|
- &dagChecker,
|
|
|
- config,
|
|
|
- debugDefines,
|
|
|
- language);
|
|
|
-
|
|
|
- std::vector<cmTargetInternals::TargetPropertyEntry*>
|
|
|
- linkInterfaceCompileDefinitionsEntries;
|
|
|
- this->Internal->AddInterfaceEntries(
|
|
|
- this, config, "INTERFACE_COMPILE_DEFINITIONS",
|
|
|
- linkInterfaceCompileDefinitionsEntries);
|
|
|
- if (!config.empty())
|
|
|
- {
|
|
|
- std::string configPropName = "COMPILE_DEFINITIONS_"
|
|
|
- + cmSystemTools::UpperCase(config);
|
|
|
- const char *configProp = this->GetProperty(configPropName);
|
|
|
- if (configProp)
|
|
|
- {
|
|
|
- switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0043))
|
|
|
- {
|
|
|
- case cmPolicies::WARN:
|
|
|
- {
|
|
|
- std::ostringstream e;
|
|
|
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0043);
|
|
|
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING,
|
|
|
- e.str());
|
|
|
- }
|
|
|
- case cmPolicies::OLD:
|
|
|
- {
|
|
|
- cmGeneratorExpression ge;
|
|
|
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
|
|
|
- ge.Parse(configProp);
|
|
|
- linkInterfaceCompileDefinitionsEntries
|
|
|
- .push_back(new cmTargetInternals::TargetPropertyEntry(cge));
|
|
|
- }
|
|
|
- break;
|
|
|
- case cmPolicies::NEW:
|
|
|
- case cmPolicies::REQUIRED_ALWAYS:
|
|
|
- case cmPolicies::REQUIRED_IF_USED:
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- processCompileDefinitions(this,
|
|
|
- linkInterfaceCompileDefinitionsEntries,
|
|
|
- list,
|
|
|
- uniqueOptions,
|
|
|
- &dagChecker,
|
|
|
- config,
|
|
|
- debugDefines,
|
|
|
- language);
|
|
|
-
|
|
|
- cmDeleteAll(linkInterfaceCompileDefinitionsEntries);
|
|
|
-}
|
|
|
-
|
|
|
//----------------------------------------------------------------------------
|
|
|
void cmTarget::MaybeInvalidatePropertyCache(const std::string& prop)
|
|
|
{
|
|
|
@@ -4034,7 +3884,6 @@ cmTargetInternalPointer
|
|
|
//----------------------------------------------------------------------------
|
|
|
cmTargetInternalPointer::~cmTargetInternalPointer()
|
|
|
{
|
|
|
- cmDeleteAll(this->Pointer->CompileDefinitionsItems);
|
|
|
cmDeleteAll(this->Pointer->SourceEntries);
|
|
|
delete this->Pointer;
|
|
|
}
|