From 7534c67799ba839593edd0ffa6339c86ce38e18f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 10 Mar 2022 09:58:46 +0200 Subject: Remove update variable from source of synthesized dependency --- libbuild2/cc/link-rule.cxx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'libbuild2/cc/link-rule.cxx') diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx index 97834fd..50c56a4 100644 --- a/libbuild2/cc/link-rule.cxx +++ b/libbuild2/cc/link-rule.cxx @@ -1589,7 +1589,20 @@ namespace build2 (!group || !rt.has_prerequisites ())) { prerequisites ps; - ps.push_back (p.as_prerequisite ()); // Source. + + // Add source. + // + // Remove the update variable (we may have stray update=execute + // that was specified together with the header). + // + { + prerequisite pc (p.as_prerequisite ()); + + if (!pc.vars.empty ()) + pc.vars.erase (*ctx.var_update); + + ps.push_back (move (pc)); + } // Add our lib*{} (see the export.* machinery for details) and // bmi*{} (both original and chained; see module search logic) -- cgit v1.1