summaryrefslogtreecommitdiff
path: root/src/task.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2025-01-17 09:49:35 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2025-01-20 17:24:44 +0100
commitc034ebb36e5d23ba1a4e7e123c7dce4f3ea7bba9 (patch)
tree5b3f8a6ab78815e0437a70c785fe737f360dd667 /src/task.cc
parent4f77a82425f60ff928880048dfa79fdd6fba56d8 (diff)
Refactor task == std::string comparison
Diffstat (limited to 'src/task.cc')
-rw-r--r--src/task.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/task.cc b/src/task.cc
index cd03fce..ef7731b 100644
--- a/src/task.cc
+++ b/src/task.cc
@@ -48,10 +48,11 @@ bool Task::operator==(const std::string& depStr)
std::filesystem::path generated_output = sourceDir;
generated_output /= target();
return
- name() == depStr ||
- target() == depStr ||
- generated_output == depStr ||
- targetFile().string() == depStr
+ (!derived() && name() == depStr) || // compare to name
+ (!derived() && config.target == depStr) || // compare to stated target (ex. foo.a)
+ target() == depStr || // compare to derived (derived to foo.lib on msvc)
+ generated_output == depStr || // not sure what this is for?!
+ targetFile().string() == depStr // compare to target output file
;
}