cmTarget: Improve const correctness of AddUtility

This commit is contained in:
Orkun Tokdemir
2023-05-31 17:46:48 +02:00
committed by Brad King
parent 5e513e562f
commit feb56a666f
2 changed files with 3 additions and 2 deletions

View File

@@ -1218,7 +1218,8 @@ void cmTarget::SetLanguageStandardProperty(std::string const& lang,
languageStandardProperty.Backtraces.emplace_back(featureBacktrace);
}
void cmTarget::AddUtility(std::string const& name, bool cross, cmMakefile* mf)
void cmTarget::AddUtility(std::string const& name, bool cross,
cmMakefile const* mf)
{
this->impl->Utilities.insert(BT<std::pair<std::string, bool>>(
{ name, cross }, mf ? mf->GetBacktrace() : cmListFileBacktrace()));

View File

@@ -174,7 +174,7 @@ public:
* commands. It is not a full path nor does it have an extension.
*/
void AddUtility(std::string const& name, bool cross,
cmMakefile* mf = nullptr);
cmMakefile const* mf = nullptr);
void AddUtility(BT<std::pair<std::string, bool>> util);
//! Get the utilities used by this target
std::set<BT<std::pair<std::string, bool>>> const& GetUtilities() const;