aboutsummaryrefslogtreecommitdiff
path: root/build2
diff options
context:
space:
mode:
Diffstat (limited to 'build2')
-rw-r--r--build2/version/rule.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/build2/version/rule.cxx b/build2/version/rule.cxx
index 6909b92..6632d55 100644
--- a/build2/version/rule.cxx
+++ b/build2/version/rule.cxx
@@ -453,9 +453,16 @@ namespace build2
string r;
- r += "#if !(" + cond () + ")\n";
- r += "# error incompatible " + n + " version, ";
- r += n + ' ' + c.string () + " is required\n";
+ // This is tricky: if the version header hasn't been generated yet,
+ // then the check will fail. Maybe a better solution is to disable
+ // diagnostics and ignore (some) errors during dependency
+ // extraction.
+ //
+ r += "#ifdef " + vm + "\n";
+ r += "# if !(" + cond () + ")\n";
+ r += "# error incompatible " + n + " version, ";
+ r += n + ' ' + c.string () + " is required\n";
+ r += "# endif\n";
r += "#endif";
return r;