diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-02-18 13:04:50 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-02-18 13:04:50 +0200 |
commit | ad59fab667c469f928e8897a762b3d5f519aba82 (patch) | |
tree | d65f940a3e968decc37cf9ff8f0ddda13071c702 | |
parent | afae6bdd843687b8fa6fe7e619532696389cfc0d (diff) |
Skip subdirs logic if installation path includes file name
-rw-r--r-- | build2/install/rule.cxx | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/build2/install/rule.cxx b/build2/install/rule.cxx index 5523a73..a30cbd3 100644 --- a/build2/install/rule.cxx +++ b/build2/install/rule.cxx @@ -621,10 +621,14 @@ namespace build2 dir_path d (n ? p->directory () : path_cast<dir_path> (*p)); install_dirs ids (resolve (f, d)); - if (auto l = f["install.subdirs"]) + + if (!n) { - if (cast<bool> (l)) - resolve_subdir (ids, f, f.base_scope (), l); + if (auto l = f["install.subdirs"]) + { + if (cast<bool> (l)) + resolve_subdir (ids, f, f.base_scope (), l); + } } return ids.back ().dir / (n ? p->leaf () : f.path ().leaf ()); @@ -868,12 +872,16 @@ namespace build2 // install_dirs ids (resolve (t, d)); - // Handle install.subdirs if one was specified. + // Handle install.subdirs if one was specified. Unless the target path + // includes the file name in which case we assume it's a "final" path. // - if (auto l = t["install.subdirs"]) + if (!n) { - if (cast<bool> (l)) - resolve_subdir (ids, t, t.base_scope (), l); + if (auto l = t["install.subdirs"]) + { + if (cast<bool> (l)) + resolve_subdir (ids, t, t.base_scope (), l); + } } // Create leading directories. Note that we are using the leading @@ -1135,10 +1143,13 @@ namespace build2 // Handle install.subdirs if one was specified. // - if (auto l = t["install.subdirs"]) + if (!n) { - if (cast<bool> (l)) - resolve_subdir (ids, t, t.base_scope (), l); + if (auto l = t["install.subdirs"]) + { + if (cast<bool> (l)) + resolve_subdir (ids, t, t.base_scope (), l); + } } // Remove extras and the target itself. |