summaryrefslogtreecommitdiff
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-02-10 01:24:42 -0500
committerBen Boeckel <ben.boeckel@kitware.com>2014-07-17 11:17:50 -0400
commitcd54f1dbeb5c71b400ccb0db81a0fcea45df46b8 (patch)
treea86374ff1f2e0cb5f2e96953bcf8bc685ad2fb40 /Source/cmTarget.cxx
parentb75fc0e1ad343173f5231819cfcdbdee9a8b076a (diff)
downloadcmake-cd54f1dbeb5c71b400ccb0db81a0fcea45df46b8.tar.gz
cmTarget: Only copy GenEx expansions when necessary
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx23
1 files changed, 13 insertions, 10 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 41d370c0c5..5836d7b452 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2266,25 +2266,32 @@ static void processCompileOptionsInternal(cmTarget const* tgt,
for (std::vector<cmTargetInternals::TargetPropertyEntry*>::const_iterator
it = entries.begin(), end = entries.end(); it != end; ++it)
{
- bool cacheOptions = false;
- std::vector<std::string> entryOptions = (*it)->CachedEntries;
- if(entryOptions.empty())
+ std::vector<std::string>& entriesRef = (*it)->CachedEntries;
+ std::vector<std::string> localEntries;
+ std::vector<std::string>* entryOptions = &entriesRef;
+ if(entryOptions->empty())
{
cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
config,
false,
tgt,
dagChecker),
- entryOptions);
+ localEntries);
if (mf->IsGeneratingBuildSystem()
&& !(*it)->ge->GetHadContextSensitiveCondition())
{
- cacheOptions = true;
+ // Cache the result.
+ *entryOptions = localEntries;
+ }
+ else
+ {
+ // Use the context-sensitive results here.
+ entryOptions = &localEntries;
}
}
std::string usedOptions;
for(std::vector<std::string>::iterator
- li = entryOptions.begin(); li != entryOptions.end(); ++li)
+ li = entryOptions->begin(); li != entryOptions->end(); ++li)
{
std::string opt = *li;
@@ -2297,10 +2304,6 @@ static void processCompileOptionsInternal(cmTarget const* tgt,
}
}
}
- if (cacheOptions)
- {
- (*it)->CachedEntries = entryOptions;
- }
if (!usedOptions.empty())
{
mf->GetCMakeInstance()->IssueMessage(cmake::LOG,