]> git.tdb.fi Git - builder.git/blobdiff - source/target.cpp
Get rid of the install flags, which weren't entirely correct anyway
[builder.git] / source / target.cpp
index 095228b3b397c86434539e98c51cdc23ba4ef4e0..577438b3528dce736aa3c22077e0857a24f5a0b4 100644 (file)
@@ -3,7 +3,7 @@
 #include <msp/strings/format.h>
 #include "builder.h"
 #include "filetarget.h"
-#include "package.h"
+#include "sourcepackage.h"
 #include "target.h"
 #include "task.h"
 #include "tool.h"
@@ -55,13 +55,13 @@ void Target::force_rebuild()
        mark_rebuild("Forced rebuild");
 }
 
-void Target::add_depend(Target *dep)
+void Target::add_depend(Target &dep)
 {
-       if(dep==this)
+       if(&dep==this)
                throw invalid_argument("Target::add_depend");
-       depends.push_back(dep);
+       depends.push_back(&dep);
        if(state>PREPARING)
-               dep->signal_bubble_rebuild.connect(sigc::mem_fun(this, &Target::check_rebuild));
+               dep.signal_bubble_rebuild.connect(sigc::mem_fun(this, &Target::check_rebuild));
 }
 
 void Target::prepare()
@@ -79,7 +79,7 @@ void Target::prepare()
        if(tool)
        {
                if(FileTarget *tool_exe = tool->get_executable())
-                       add_depend(tool_exe);
+                       add_depend(*tool_exe);
        }
 
        for(Dependencies::iterator i=depends.begin(); i!=depends.end(); ++i)
@@ -97,6 +97,7 @@ Task *Target::build()
 {
        if(!tool)
        {
+               // This special case is needed for VirtualTargets
                state = UPTODATE;
                return 0;
        }