aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/parser.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-05-08 15:43:13 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-05-27 08:35:29 +0200
commit9a0f07035b34a356ce9b5601d71d388595762184 (patch)
tree9a1d52a23655529706d2f6ec669083e178b37aed /libbuild2/parser.cxx
parent66b6e20659a0d611e89adde85cd7bcb34a92a2c7 (diff)
Generalize to adhoc_rule/adhoc_script_rule
Diffstat (limited to 'libbuild2/parser.cxx')
-rw-r--r--libbuild2/parser.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx
index aa4ada9..54c2065 100644
--- a/libbuild2/parser.cxx
+++ b/libbuild2/parser.cxx
@@ -9,6 +9,7 @@
#include <libbutl/filesystem.mxx> // path_search
#include <libbutl/path-pattern.mxx>
+#include <libbuild2/rule.hxx>
#include <libbuild2/dump.hxx>
#include <libbuild2/scope.hxx>
#include <libbuild2/module.hxx>
@@ -1086,13 +1087,18 @@ namespace build2
fail (t) << "unterminated recipe block" <<
info (st) << "recipe block starts here" << endf;
+ // @@ TODO: we need to reuse the same rules for all the targets! Kill
+ // me now.
+ //
+ shared_ptr<adhoc_rule> ar (
+ new adhoc_script_rule (move (t.value),
+ move (diag),
+ get_location (st),
+ st.value.size ()));
+
action a (perform_id, update_id);
- target_->adhoc_recipes.emplace_back (a,
- move (t.value),
- move (diag),
- get_location (st),
- st.value.size ());
+ target_->adhoc_recipes.push_back (adhoc_recipe {a, move (ar)});
next (t, tt);
assert (tt == type::multi_rcbrace);