From 95b5df8646fa2b02c5eba175570f83fc6e2ece55 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 22 Jul 2020 10:45:33 -0400 Subject: cmGeneratorTarget: Skip computing languages for custom targets Targets created by `add_custom_target` do not compile any sources and therefore have no languages. --- Source/cmGeneratorTarget.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index beafdea..554a954 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -7013,6 +7013,11 @@ std::string cmGeneratorTarget::GetDeprecation() const void cmGeneratorTarget::GetLanguages(std::set& languages, const std::string& config) const { + // Targets that do not compile anything have no languages. + if (!this->CanCompileSources()) { + return; + } + std::vector sourceFiles; this->GetSourceFiles(sourceFiles, config); for (cmSourceFile* src : sourceFiles) { -- cgit v0.12