Parcourir la source

cmTarget: Improve const correctness of AddUtility

Orkun Tokdemir il y a 2 ans
Parent
commit
feb56a666f
2 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 2 1
      Source/cmTarget.cxx
  2. 1 1
      Source/cmTarget.h

+ 2 - 1
Source/cmTarget.cxx

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

+ 1 - 1
Source/cmTarget.h

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