Browse Source

cmTarget: Inline SetType method at only remaining call site

Brad King 9 years ago
parent
commit
7a2e114dd8
2 changed files with 6 additions and 10 deletions
  1. 6 9
      Source/cmTarget.cxx
  2. 0 1
      Source/cmTarget.h

+ 6 - 9
Source/cmTarget.cxx

@@ -63,6 +63,8 @@ cmTarget::cmTarget(std::string const& name, cmState::TargetType type,
                    Visibility vis, cmMakefile* mf)
 {
   assert(mf || type == cmState::GLOBAL_TARGET);
+  this->Name = name;
+  this->TargetTypeValue = type;
   this->Makefile = CM_NULLPTR;
   this->HaveInstallRule = false;
   this->DLLPlatform = false;
@@ -71,23 +73,18 @@ cmTarget::cmTarget(std::string const& name, cmState::TargetType type,
     (vis == VisibilityImported || vis == VisibilityImportedGlobally);
   this->ImportedGloballyVisible = vis == VisibilityImportedGlobally;
   this->BuildInterfaceIncludesAppended = false;
-  this->SetType(type, name);
-  if (mf) {
-    this->SetMakefile(mf);
-  }
-}
 
-void cmTarget::SetType(cmState::TargetType type, const std::string& name)
-{
-  this->Name = name;
   // only add dependency information for library targets
-  this->TargetTypeValue = type;
   if (this->TargetTypeValue >= cmState::STATIC_LIBRARY &&
       this->TargetTypeValue <= cmState::MODULE_LIBRARY) {
     this->RecordDependencies = true;
   } else {
     this->RecordDependencies = false;
   }
+
+  if (mf) {
+    this->SetMakefile(mf);
+  }
 }
 
 cmTarget cmTarget::CopyForDirectory(cmMakefile* mf) const

+ 0 - 1
Source/cmTarget.h

@@ -283,7 +283,6 @@ public:
   };
 
 private:
-  void SetType(cmState::TargetType f, const std::string& name);
   void SetMakefile(cmMakefile* mf);
 
   bool HandleLocationPropertyPolicy(cmMakefile* context) const;