summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceFile.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmSourceFile.cxx')
-rw-r--r--Source/cmSourceFile.cxx21
1 files changed, 4 insertions, 17 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 4deb94a..3344217 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -5,7 +5,6 @@
#include <array>
#include <utility>
-#include "cmCustomCommand.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
@@ -21,11 +20,6 @@ cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name,
{
}
-cmSourceFile::~cmSourceFile()
-{
- this->SetCustomCommand(nullptr);
-}
-
std::string const& cmSourceFile::GetExtension() const
{
return this->Extension;
@@ -320,19 +314,12 @@ bool cmSourceFile::GetPropertyAsBool(const std::string& prop) const
return cmIsOn(this->GetProperty(prop));
}
-cmCustomCommand* cmSourceFile::GetCustomCommand()
-{
- return this->CustomCommand;
-}
-
-cmCustomCommand const* cmSourceFile::GetCustomCommand() const
+cmCustomCommand* cmSourceFile::GetCustomCommand() const
{
- return this->CustomCommand;
+ return this->CustomCommand.get();
}
-void cmSourceFile::SetCustomCommand(cmCustomCommand* cc)
+void cmSourceFile::SetCustomCommand(std::unique_ptr<cmCustomCommand> cc)
{
- cmCustomCommand* old = this->CustomCommand;
- this->CustomCommand = cc;
- delete old;
+ this->CustomCommand = std::move(cc);
}