From ad99a55b0bb615f20cec9880aeb96ab0779d56d0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 16 Dec 2015 13:22:01 +0200 Subject: Tweak install rule One day we are going to get it right... --- build/install/rule.cxx | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'build') diff --git a/build/install/rule.cxx b/build/install/rule.cxx index 854832c..fa648b5 100644 --- a/build/install/rule.cxx +++ b/build/install/rule.cxx @@ -89,12 +89,18 @@ namespace build // First determine if this target should be installed (called // "installable" for short). // - match_result mr (t, lookup (t, "install") != nullptr); + if (lookup (t, "install") == nullptr) + // If this is the update pre-operation, signal that we don't match so + // that some other rule can take care of it. + // + return a.operation () == update_id ? nullptr : match_result (t, false); + + match_result mr (t, true); // If this is the update pre-operation, change the recipe action // to (update, 0) (i.e., "unconditional update"). // - if (mr.bvalue && a.operation () == update_id) + if (a.operation () == update_id) mr.recipe_action = action (a.meta_operation (), update_id); return mr; @@ -136,17 +142,18 @@ namespace build if (p.proj () != nullptr) continue; - // @@ This is where we will handle [noinstall]. - // - // Let a customized rule have its say. // - // @@ This will be skipped if forced with [install]? - // target* pt (filter (a, t, p)); if (pt == nullptr) continue; + // See if the user instructed us not to install it. + // + auto l ((*pt)["install"]); + if (l && as (*l).string () == "false") + continue; + build::match (a, *pt); // If the matched rule returned noop_recipe, then the target -- cgit v1.1