diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-03-20 05:50:12 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-03-20 05:50:12 +0200 |
commit | aeda0dedb2cdb0980d976ae92e1672476b62d7ed (patch) | |
tree | 95988df9cf55ed4b50b6fb9220e98bab5e20f994 /libbuild2 | |
parent | a9bfeabe70a05b4e0776d31a4ae62983bb9fc6e3 (diff) |
Don't install ad hoc members with unassigned paths
Diffstat (limited to 'libbuild2')
-rw-r--r-- | libbuild2/install/rule.cxx | 31 |
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); |