diff options
author | Brad King <brad.king@kitware.com> | 2023-09-06 14:55:32 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-09-06 14:55:44 (GMT) |
commit | 6cda2b12702a07c43fd3b8723901d00baa1750e8 (patch) | |
tree | b8b56081a5dea59720056e3bece9167e2830b325 /Source | |
parent | c1dc341776957a17860a1c56f918cff828316c7b (diff) | |
parent | 045d8eca6c79efc442cacf59cbcff83cc6085dbf (diff) | |
download | CMake-6cda2b12702a07c43fd3b8723901d00baa1750e8.zip CMake-6cda2b12702a07c43fd3b8723901d00baa1750e8.tar.gz CMake-6cda2b12702a07c43fd3b8723901d00baa1750e8.tar.bz2 |
Merge topic 'fortran-object-libraries'
045d8eca6c Merge branch 'fortran-object-libraries-release' into fortran-object-libraries
74b1d6caf3 cmComputeLinkInformation: compute link info for module-using targets
6251edaed1 cmGeneratorTarget: support config-independent Fortran source queries
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8772
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 7 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 9 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.h | 1 |
3 files changed, 15 insertions, 2 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index ccd20a0..91395e2 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -538,11 +538,14 @@ cmComputeLinkInformation::GetSharedLibrariesLinked() const bool cmComputeLinkInformation::Compute() { - // Skip targets that do not link. + // Skip targets that do not link or have link-like information consumers may + // need (namely modules). if (!(this->Target->GetType() == cmStateEnums::EXECUTABLE || this->Target->GetType() == cmStateEnums::SHARED_LIBRARY || this->Target->GetType() == cmStateEnums::MODULE_LIBRARY || - this->Target->GetType() == cmStateEnums::STATIC_LIBRARY)) { + this->Target->GetType() == cmStateEnums::STATIC_LIBRARY || + this->Target->HaveCxx20ModuleSources() || + this->Target->HaveFortranSources())) { return false; } diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 7799e1c..764618e 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -9042,6 +9042,15 @@ bool cmGeneratorTarget::HaveFortranSources(std::string const& config) const }); } +bool cmGeneratorTarget::HaveFortranSources() const +{ + auto sources = cmGeneratorTarget::GetAllConfigSources(); + return std::any_of(sources.begin(), sources.end(), + [](AllConfigSource const& sf) -> bool { + return sf.Source->GetLanguage() == "Fortran"_s; + }); +} + bool cmGeneratorTarget::HaveCxx20ModuleSources(std::string* errorMessage) const { auto const& fs_names = this->Target->GetAllFileSetNames(); diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index f347133..7673bef 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -1262,6 +1262,7 @@ public: cmGeneratorTarget const* t2) const; }; + bool HaveFortranSources() const; bool HaveFortranSources(std::string const& config) const; // C++20 module support queries. |