aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/install/rule.cxx31
1 files changed, 23 insertions, 8 deletions
diff --git a/libbuild2/install/rule.cxx b/libbuild2/install/rule.cxx
index 23e1004..f1d8b8f 100644
--- a/libbuild2/install/rule.cxx
+++ b/libbuild2/install/rule.cxx
@@ -980,10 +980,16 @@ namespace build2
//
for (const target* m (t.member); m != nullptr; m = m->member)
{
- if (const path* p = lookup_install<path> (*m, "install"))
+ if (const file* mf = m->is_a<file> ())
{
- install_target (m->as<file> (), *p, tp.empty () ? 1 : 2);
- r |= target_state::changed;
+ if (!mf->path ().empty ())
+ {
+ if (const path* p = lookup_install<path> (*mf, "install"))
+ {
+ install_target (*mf, *p, tp.empty () ? 1 : 2);
+ r |= target_state::changed;
+ }
+ }
}
}
@@ -1252,13 +1258,22 @@ namespace build2
//
for (const target* m (t.member); m != nullptr; m = m->member)
{
- if (const path* p = lookup_install<path> (*m, "install"))
- r |= uninstall_target (
- m->as<file> (),
- *p,
- tp.empty () || r != target_state::changed ? 1 : 2);
+ if (const file* mf = m->is_a<file> ())
+ {
+ if (!mf->path ().empty ())
+ {
+ if (const path* p = lookup_install<path> (*m, "install"))
+ {
+ r |= uninstall_target (
+ *mf,
+ *p,
+ tp.empty () || r != target_state::changed ? 1 : 2);
+ }
+ }
+ }
}
+
// Finally handle installable prerequisites.
//
r |= reverse_execute_prerequisites (a, t);