summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.h
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-04-08 22:05:36 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-09 08:37:00 (GMT)
commitb1c3ae33eacb55a54a7ce28c5a5d6aa8903fbac2 (patch)
treee02d733bfc9e400853009984b2fe89e37763210d /Source/cmTarget.h
parent9b1abc543e9aee946e093229e1715c4b8a961514 (diff)
downloadCMake-b1c3ae33eacb55a54a7ce28c5a5d6aa8903fbac2.zip
CMake-b1c3ae33eacb55a54a7ce28c5a5d6aa8903fbac2.tar.gz
CMake-b1c3ae33eacb55a54a7ce28c5a5d6aa8903fbac2.tar.bz2
cmTarget: Short-circuit language computation if context independent.
Computing the language involves computing the source files, which is an expensive operation. It requires calling cmMakefile::GetOrCreateSource many times, which involves creating and matching on many cmSourceFileLocation objects. Source files of a target may depend on the head-target and the config as of commit e6971df6 (cmTarget: Make the source files depend on the config., 2014-02-13). The results are cached for each context as of commit c5b26f3b (cmTarget: Cache the cmSourceFiles in GetSourceFiles., 2014-04-05). Each target in the build graph causes language computation of all of its dependents with itself as the head-target. This means that for 'core' libraries on which everything depends, the source files are computed once for every transitive target-level-dependee and the result is not cached because the head-target is different. This was observed in the VTK buildsystem. Short circuit the computation for targets which have a source-list that is independent of the head-target. If the source-list has already been computed and the generator expression evaluation reports that it was context-independent, return the only source-list already cached for the target. Reset the short-circuit logic when sources are added and when the link libraries are re-computed.
Diffstat (limited to 'Source/cmTarget.h')
-rw-r--r--Source/cmTarget.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index da9d0a1..868e260 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -784,6 +784,8 @@ private:
std::string const& suffix,
std::string const& name,
const char* version) const;
+
+ mutable bool LinkImplementationLanguageIsContextDependent;
};
typedef std::map<std::string,cmTarget> cmTargets;