diff options
author | Brad King <brad.king@kitware.com> | 2020-10-19 15:06:39 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-12-10 07:06:20 -0500 |
commit | e4034eabe930fb677fb9b5c65cf29336d1ff123c (patch) | |
tree | fb6b72178c2e2df3d7e81bbe5057d50d4cd8117e /Source/cmLocalGenerator.cxx | |
parent | 706c48301d29124e2ec4cd554b0de86d3743d62d (diff) | |
download | cmake-e4034eabe930fb677fb9b5c65cf29336d1ff123c.tar.gz |
cmLocalGenerator: Re-order logic in CreateGeneratedSource
Return early on errors to reduce nesting.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index c9dfdeacf4..5739c03296 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -3816,18 +3816,19 @@ void CreateGeneratedSource(cmLocalGenerator& lg, const std::string& output, cmCommandOrigin origin, const cmListFileBacktrace& lfbt) { - if (cmGeneratorExpression::Find(output) == std::string::npos) { - // Outputs without generator expressions from the project are already - // created and marked as generated. Do not mark them again, because - // other commands might have overwritten the property. - if (origin == cmCommandOrigin::Generator) { - lg.GetMakefile()->GetOrCreateGeneratedSource(output); - } - } else { + if (cmGeneratorExpression::Find(output) != std::string::npos) { lg.GetCMakeInstance()->IssueMessage( MessageType::FATAL_ERROR, "Generator expressions in custom command outputs are not implemented!", lfbt); + return; + } + + // Outputs without generator expressions from the project are already + // created and marked as generated. Do not mark them again, because + // other commands might have overwritten the property. + if (origin == cmCommandOrigin::Generator) { + lg.GetMakefile()->GetOrCreateGeneratedSource(output); } } |