瀏覽代碼

cmTarget: Improve const correctness of AddUtility

Orkun Tokdemir 2 年之前
父節點
當前提交
feb56a666f
共有 2 個文件被更改,包括 3 次插入2 次删除
  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);
 }
 
-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()));

+ 1 - 1
Source/cmTarget.h

@@ -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;