diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-08-07 14:59:07 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-08-07 19:32:10 +0200 |
commit | c2b4305349ca855c497904282db354de56c74842 (patch) | |
tree | 13ff2901d1ab491d930f81cee6fa49e5cff11577 /build2/cc/common.cxx | |
parent | 7149c8eaeec3efcfc9da0f89c9ae979ff2c07fd5 (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/cc/common.cxx')
-rw-r--r-- | build2/cc/common.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/build2/cc/common.cxx b/build2/cc/common.cxx index ca73483..c6ef3bd 100644 --- a/build2/cc/common.cxx +++ b/build2/cc/common.cxx @@ -431,11 +431,9 @@ namespace build2 { // This is import. // - optional<string> ext; - - // Changes name. - // - const target_type* tt (s.find_target_type (n, ext, location ())); + auto rp (s.find_target_type (n, location ())); // Note: changes name. + const target_type* tt (rp.first); + optional<string>& ext (rp.second); if (tt == nullptr) fail << "unknown target type '" << n.type << "' in library " << n; |