aboutsummaryrefslogtreecommitdiff
path: root/build2/install/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-08-02 11:18:38 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-08-02 11:33:51 +0200
commite65c406301c3a7b30174f8706ba39584e80ddf25 (patch)
tree39ab598476f4965616979f498e016e3f7913008c /build2/install/rule.cxx
parente8ef2fbd339afd8113bd92d371bc49d7d570c32f (diff)
Save module map to pkg-config files
Diffstat (limited to 'build2/install/rule.cxx')
-rw-r--r--build2/install/rule.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/build2/install/rule.cxx b/build2/install/rule.cxx
index c76800a..1f14fce 100644
--- a/build2/install/rule.cxx
+++ b/build2/install/rule.cxx
@@ -399,6 +399,29 @@ namespace build2
return move (resolve (t, move (d)).back ().dir);
}
+ path
+ resolve_file (const file& f)
+ {
+ // Note: similar logic to perform_install().
+ //
+ const path* p (lookup_install<path> (f, "install"));
+
+ if (p == nullptr) // Not installable.
+ return path ();
+
+ bool n (!p->to_directory ());
+ dir_path d (n ? p->directory () : path_cast<dir_path> (*p));
+
+ install_dirs ids (resolve (f, d));
+ 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 ());
+ }
+
// On Windows we use MSYS2 install.exe and MSYS2 by default ignores
// filesystem permissions (noacl mount option). And this means, for
// example, that .exe that we install won't be runnable by Windows (MSYS2
@@ -631,6 +654,8 @@ namespace build2
auto install_target = [this] (const file& t, const path& p, bool verbose)
{
+ // Note: similar logic to resolve_file().
+ //
bool n (!p.to_directory ());
dir_path d (n ? p.directory () : path_cast<dir_path> (p));