summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rebuild.cc5
-rw-r--r--src/task.cc5
-rw-r--r--src/task_fn.cc2
3 files changed, 8 insertions, 4 deletions
diff --git a/src/rebuild.cc b/src/rebuild.cc
index 1db5e83..4ca1809 100644
--- a/src/rebuild.cc
+++ b/src/rebuild.cc
@@ -186,7 +186,10 @@ bool recompileCheck(const ctor::settings& global_settings, int argc, char* argv[
ctor::settings settings{global_settings};
settings.verbose = -1; // Make check completely silent.
- settings.builddir += "/ctor"; // override builddir to use ctor subdir
+
+ // override builddir to use ctor subdir
+ auto ctor_builddir = std::filesystem::path(settings.builddir) / "ctor";
+ settings.builddir = ctor_builddir.string();
{
std::filesystem::path buildfile = settings.builddir;
diff --git a/src/task.cc b/src/task.cc
index a9c0fee..cd03fce 100644
--- a/src/task.cc
+++ b/src/task.cc
@@ -3,7 +3,6 @@
// See accompanying file LICENSE for details.
#include "task.h"
-#include <unistd.h>
#include <iostream>
#include <algorithm>
#include <utility>
@@ -46,10 +45,12 @@ int Task::registerDepTasks(const std::vector<std::shared_ptr<Task>>& tasks)
bool Task::operator==(const std::string& depStr)
{
+ std::filesystem::path generated_output = sourceDir;
+ generated_output /= target();
return
name() == depStr ||
target() == depStr ||
- sourceDir + "/" + target() == depStr ||
+ generated_output == depStr ||
targetFile().string() == depStr
;
}
diff --git a/src/task_fn.cc b/src/task_fn.cc
index 873dc44..1ff72f9 100644
--- a/src/task_fn.cc
+++ b/src/task_fn.cc
@@ -98,7 +98,7 @@ std::vector<std::string> TaskFn::depends() const
std::string TaskFn::target() const
{
- return _targetFile;
+ return _targetFile.string();
}
std::filesystem::path TaskFn::targetFile() const