diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-11-04 22:24:54 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-11-12 21:36:45 (GMT) |
commit | b80557c7bdf12f9e924ac8b010d547ce4561848e (patch) | |
tree | 67b5bc2ed5509a7ab116bfa16e8757324c651ad3 /Source/cmGeneratorExpression.h | |
parent | 0019d54b6e4bfde7ef1c211a1c5e5bab194381b2 (diff) | |
download | CMake-b80557c7bdf12f9e924ac8b010d547ce4561848e.zip CMake-b80557c7bdf12f9e924ac8b010d547ce4561848e.tar.gz CMake-b80557c7bdf12f9e924ac8b010d547ce4561848e.tar.bz2 |
file(GENERATE): Evaluate early to allow generating source files
The evaluation files must be known before cmTargetTraceDependencies
attempts to find them, but we must actually generate the files after
cmTargetTraceDependencies, as that can add to target SOURCES. The
limitation is that the generated output name must not depend on the
SOURCES of a target if the generated file is used by that target.
Mark the output files as GENERATED so that trace dependencies does
not expect them to already exist in the filesystem.
Move the invokation of ForceLinkerLanguage in the Generate logic
to after the generated file names are known. ForceLinkerLanguage
tries to determine the sources of a target (in order to determine
an already-known language) and otherwise fails to get information
about the generated file.
Test that the output of file(GENERATE) can be used as a target source
file and that accessing the target SOURCES in the name of the output
file is an error. Accessing the TARGET_OBJECTS would be a similar
error if it was legal to use that generator expression in this
context. That is not currently possible and is a different error
condition, so test the current error output as a reminder to change
the expected output if that becomes possible in the future. Test
that generated rule files resulting from cmTargetTraceDependencies
appear in the SOURCES generated in the output file.
Diffstat (limited to 'Source/cmGeneratorExpression.h')
-rw-r--r-- | Source/cmGeneratorExpression.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index b952520..57f78c5 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -115,6 +115,10 @@ public: { return this->HadHeadSensitiveCondition; } + std::set<cmTarget const*> GetSourceSensitiveTargets() const + { + return this->SourceSensitiveTargets; + } void SetEvaluateForBuildsystem(bool eval) { @@ -146,6 +150,7 @@ private: mutable std::string Output; mutable bool HadContextSensitiveCondition; mutable bool HadHeadSensitiveCondition; + mutable std::set<cmTarget const*> SourceSensitiveTargets; bool EvaluateForBuildsystem; }; |