diff options
author | Brad King <brad.king@kitware.com> | 2020-07-22 14:45:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-07-23 17:31:45 (GMT) |
commit | 95b5df8646fa2b02c5eba175570f83fc6e2ece55 (patch) | |
tree | b1f0d92af3ef25b4e1beee7906b9bd16b1798ff0 | |
parent | 2f0790df5046bfc99383317eb7d24cd4030200be (diff) | |
download | CMake-95b5df8646fa2b02c5eba175570f83fc6e2ece55.zip CMake-95b5df8646fa2b02c5eba175570f83fc6e2ece55.tar.gz CMake-95b5df8646fa2b02c5eba175570f83fc6e2ece55.tar.bz2 |
cmGeneratorTarget: Skip computing languages for custom targets
Targets created by `add_custom_target` do not compile any sources
and therefore have no languages.
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
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<std::string>& languages, const std::string& config) const { + // Targets that do not compile anything have no languages. + if (!this->CanCompileSources()) { + return; + } + std::vector<cmSourceFile*> sourceFiles; this->GetSourceFiles(sourceFiles, config); for (cmSourceFile* src : sourceFiles) { |