summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rebuild.cc6
-rw-r--r--src/task.h2
-rw-r--r--src/task_cc.cc5
-rw-r--r--src/task_cc.h4
-rw-r--r--src/task_fn.cc5
-rw-r--r--src/task_fn.h2
6 files changed, 6 insertions, 18 deletions
diff --git a/src/rebuild.cc b/src/rebuild.cc
index d62e998..276947b 100644
--- a/src/rebuild.cc
+++ b/src/rebuild.cc
@@ -14,6 +14,7 @@
#include "configure.h"
#include "ctor.h"
#include "tasks.h"
+#include "task_cc.h"
#include "build.h"
#include "execute.h"
#include "tools.h"
@@ -222,9 +223,10 @@ bool recompileCheck(const ctor::settings& global_settings, int argc, char* argv[
bool reconfigure{false};
for(auto task : tasks)
{
+ auto task_cc = std::dynamic_pointer_cast<TaskCC>(task);
if(task->dirty() &&
- task->source() != "" && // only look at source files
- task->source() != "configuration.cc") // don't reconfigure if only configuration.cc is changed.
+ // don't reconfigure if only configuration.cc is changed.
+ (task_cc && task_cc->sourceFile.string() != "configuration.cc"))
{
reconfigure |= true;
}
diff --git a/src/task.h b/src/task.h
index 32d0de3..cd08ab2 100644
--- a/src/task.h
+++ b/src/task.h
@@ -65,8 +65,6 @@ public:
std::vector<std::shared_ptr<Task>> getDependsTasks();
- virtual std::string source() const { return {}; }
-
protected:
std::atomic<State> task_state{State::Unknown};
virtual int runInner() { return 0; };
diff --git a/src/task_cc.cc b/src/task_cc.cc
index 9628455..590a28a 100644
--- a/src/task_cc.cc
+++ b/src/task_cc.cc
@@ -288,11 +288,6 @@ std::string TaskCC::toJSON() const
return json;
}
-std::string TaskCC::source() const
-{
- return sourceFile.string();
-}
-
std::vector<std::string> TaskCC::flags() const
{
std::vector<std::string> flags;
diff --git a/src/task_cc.h b/src/task_cc.h
index 2299fcd..872e73d 100644
--- a/src/task_cc.h
+++ b/src/task_cc.h
@@ -35,13 +35,13 @@ public:
std::string toJSON() const override;
- std::string source() const override;
-
protected:
std::vector<std::string> flags() const;
std::string flagsString() const;
std::vector<std::string> getCompilerArgs() const;
+ friend bool recompileCheck(const ctor::settings& global_settings, int argc, char* argv[],
+ bool relaunch_allowed);
std::filesystem::path sourceFile;
std::filesystem::path _targetFile;
std::filesystem::path depsFile;
diff --git a/src/task_fn.cc b/src/task_fn.cc
index b6b50ea..abeda62 100644
--- a/src/task_fn.cc
+++ b/src/task_fn.cc
@@ -121,8 +121,3 @@ std::string TaskFn::toJSON() const
{
return {}; // TODO: Not sure how to express this...
}
-
-std::string TaskFn::source() const
-{
- return sourceFile.string();
-}
diff --git a/src/task_fn.h b/src/task_fn.h
index 1bad32c..ea9af15 100644
--- a/src/task_fn.h
+++ b/src/task_fn.h
@@ -32,8 +32,6 @@ public:
std::string toJSON() const override;
- std::string source() const override;
-
protected:
std::filesystem::path sourceFile;
std::filesystem::path _targetFile;