Merge pull request #70 from neonichu/fix-command-task-cancellation

Call `taskIsComplete()` on CommandTask cancellation
diff --git a/lib/BuildSystem/BuildSystem.cpp b/lib/BuildSystem/BuildSystem.cpp
index 8c6dde9..ba50b33 100644
--- a/lib/BuildSystem/BuildSystem.cpp
+++ b/lib/BuildSystem/BuildSystem.cpp
@@ -533,6 +533,12 @@
   }
 
   virtual void inputsAvailable(BuildEngine& engine) override {
+    // If the build should cancel, do nothing.
+    if (isCancelled(engine)) {
+      engine.taskIsComplete(this, BuildValue::makeSkippedCommand().toData());
+      return;
+    }
+
     auto& bsci = getBuildSystem(engine).getCommandInterface();
     auto fn = [this, &bsci=bsci](QueueJobContext* context) {
       bool shouldSkip = !bsci.getDelegate().shouldCommandStart(&command);