aboutsummaryrefslogtreecommitdiff
path: root/build2/algorithm.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-08-07 14:59:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-08-07 14:59:07 +0200
commite4f41c7319261b9585bd501256664679457e1d9d (patch)
tree21ef10a30d932a3172080de2690c6e38d851d0e2 /build2/algorithm.cxx
parent7149c8eaeec3efcfc9da0f89c9ae979ff2c07fd5 (diff)
Add support for default extension specification, trailing dot escaping
For example: cxx{*}: extension = cxx cxx{foo} # foo.cxx cxx{foo.test} # foo.test (probably what we want...) cxx{foo.test...} # foo.test.cxx (... is this) cxx{foo..} # foo. cxx{foo....} # foo.. cxx{foo.....} # error (must come in escape pair)
Diffstat (limited to 'build2/algorithm.cxx')
-rw-r--r--build2/algorithm.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx
index 550a491..bfe6943 100644
--- a/build2/algorithm.cxx
+++ b/build2/algorithm.cxx
@@ -49,8 +49,9 @@ namespace build2
{
assert (phase == run_phase::match);
- optional<string> ext;
- const target_type* tt (s.find_target_type (n, ext, location ()));
+ auto rp (s.find_target_type (n, location ()));
+ const target_type* tt (rp.first);
+ optional<string>& ext (rp.second);
if (tt == nullptr)
fail << "unknown target type " << n.type << " in name " << n;
@@ -77,8 +78,9 @@ namespace build2
assert (phase == run_phase::match || phase == run_phase::execute);
name n (cn);
- optional<string> ext;
- const target_type* tt (s.find_target_type (n, ext, location ()));
+ auto rp (s.find_target_type (n, location ()));
+ const target_type* tt (rp.first);
+ optional<string>& ext (rp.second);
// For now we treat an unknown target type as an unknown target. Seems
// logical.