diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2021-02-22 10:45:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-02-23 13:14:14 (GMT) |
commit | b722eea9253acd9e33921779175fc615d064577a (patch) | |
tree | 260955614807534a07e7ecb8895704d6f931cb81 /Source/cmGeneratorTarget.cxx | |
parent | c2c31ae8969686f1909fe76fef43a232332c7b54 (diff) | |
download | CMake-b722eea9253acd9e33921779175fc615d064577a.zip CMake-b722eea9253acd9e33921779175fc615d064577a.tar.gz CMake-b722eea9253acd9e33921779175fc615d064577a.tar.bz2 |
Genex: LINK_LANGUAGE respects LINKER_LANGUAGE property
If target property LINKER_LANGUAGE is set, LINK_LANGUAGE generator
expression evaluation must be always successful.
This fix can be helpful to elaborate a solution for issue #21818.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 9235faa..d7e9952 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2648,8 +2648,12 @@ void cmGeneratorTarget::ComputeLinkClosure(const std::string& config, LinkClosure linkClosure; linkClosure.LinkerLanguage = this->LinkerLanguage; + bool hasHardCodedLinkerLanguage = this->Target->GetProperty("HAS_CXX") || + !this->Target->GetSafeProperty("LINKER_LANGUAGE").empty(); + // Get languages built in this target. - secondPass = this->ComputeLinkClosure(config, linkClosure, false); + secondPass = this->ComputeLinkClosure(config, linkClosure, false) && + !hasHardCodedLinkerLanguage; this->LinkerLanguage = linkClosure.LinkerLanguage; if (!secondPass) { lc = std::move(linkClosure); |