diff options
author | Isuru Fernando <isuruf@gmail.com> | 2020-11-19 17:33:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-06-24 12:39:47 (GMT) |
commit | fe3f846e1b88341529686ee7dd334b01fe9e705e (patch) | |
tree | 95a4facd2432b9eb74d4039cd467d364d3a0ab2e /Source/cmDependsFortran.cxx | |
parent | 66488d4eb31d372d8e06ce78e5f49a7cc43974ee (diff) | |
download | CMake-fe3f846e1b88341529686ee7dd334b01fe9e705e.zip CMake-fe3f846e1b88341529686ee7dd334b01fe9e705e.tar.gz CMake-fe3f846e1b88341529686ee7dd334b01fe9e705e.tar.bz2 |
Makefiles: Add support for building Fortran intrinsics
Fixes: #21463
Diffstat (limited to 'Source/cmDependsFortran.cxx')
-rw-r--r-- | Source/cmDependsFortran.cxx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index bca26b9..6024cf6 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -163,12 +163,17 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends, mod_dir = this->LocalGenerator->GetCurrentBinaryDirectory(); } + bool building_intrinsics = + !mf->GetSafeDefinition("CMAKE_Fortran_TARGET_BUILDING_INSTRINSIC_MODULES") + .empty(); + // Actually write dependencies to the streams. using ObjectInfoMap = cmDependsFortranInternals::ObjectInfoMap; ObjectInfoMap const& objInfo = this->Internal->ObjectInfo; for (auto const& i : objInfo) { if (!this->WriteDependenciesReal(i.first, i.second, mod_dir, stamp_dir, - makeDepends, internalDepends)) { + makeDepends, internalDepends, + building_intrinsics)) { return false; } } @@ -307,7 +312,8 @@ bool cmDependsFortran::WriteDependenciesReal(std::string const& obj, std::string const& mod_dir, std::string const& stamp_dir, std::ostream& makeDepends, - std::ostream& internalDepends) + std::ostream& internalDepends, + bool buildingIntrinsics) { // Get the source file for this object. std::string const& src = info.Source; @@ -339,8 +345,13 @@ bool cmDependsFortran::WriteDependenciesReal(std::string const& obj, makeDepends << '\n'; } + std::set<std::string> req = info.Requires; + if (buildingIntrinsics) { + req.insert(info.Intrinsics.begin(), info.Intrinsics.end()); + } + // Write module requirements to the output stream. - for (std::string const& i : info.Requires) { + for (std::string const& i : req) { // Require only modules not provided in the same source. if (info.Provides.find(i) != info.Provides.cend()) { continue; |