aboutsummaryrefslogtreecommitdiff
path: root/build2/target.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-07-16 15:21:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-07-16 15:54:06 +0200
commit4f63afc1177021d6345502892dbd028f5d6db5eb (patch)
tree9f3919d7d6798a82deab6fd9ebfb1d1802b2030f /build2/target.cxx
parent55e858010b9ba53c27475d9ce6f864a84d28fa81 (diff)
Implement in module
Given test.in containing something along these lines: foo = $foo$ Now we can do: using in file{test}: in{test.in} file{test}: foo = FOO The alternative variable substitution symbol can be specified with the in.symbol variable and lax (instead of the default strict) mode with in.substitution. For example: file{test}: in.symbol = '@' file{test}: in.substitution = lax
Diffstat (limited to 'build2/target.cxx')
-rw-r--r--build2/target.cxx44
1 files changed, 0 insertions, 44 deletions
diff --git a/build2/target.cxx b/build2/target.cxx
index 973eed8..f2e3462 100644
--- a/build2/target.cxx
+++ b/build2/target.cxx
@@ -942,50 +942,6 @@ namespace build2
false
};
- // in
- //
- static const target*
- in_search (const target& xt, const prerequisite_key& cpk)
- {
- // If we have no extension then derive it from our target. Then delegate
- // to file_search().
- //
- prerequisite_key pk (cpk);
- optional<string>& e (pk.tk.ext);
-
- if (!e)
- {
- if (const file* t = xt.is_a<file> ())
- {
- const string& te (t->derive_extension ());
- e = te + (te.empty () ? "" : ".") + "in";
- }
- else
- fail << "prerequisite " << pk << " for a non-file target " << xt;
- }
-
- return file_search (xt, pk);
- }
-
- static bool
- in_pattern (const target_type&, const scope&, string&, bool)
- {
- fail << "pattern in in{} prerequisite" << endf;
- }
-
- const target_type in::static_type
- {
- "in",
- &file::static_type,
- &target_factory<in>,
- &target_extension_fix<file_ext_def>, // No extension by default.
- nullptr, /* default_extension */ // Should be taken care if by search.
- &in_pattern,
- &target_print_1_ext_verb, // Same as file.
- &in_search,
- false
- };
-
const target_type doc::static_type
{
"doc",