aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/pkgconfig.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-11-04 13:41:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-11-04 13:41:23 +0200
commit65f77bb9a9556033a0bfb7401dd9a00120e27524 (patch)
treefe287d9986936f9240e6e8fecff5880684322fd9 /libbuild2/cc/pkgconfig.cxx
parent63fb9ab4e861e5110c3652e74270f76fb858c37a (diff)
Do not apply install scope to update-for-install pre-operation
Diffstat (limited to 'libbuild2/cc/pkgconfig.cxx')
-rw-r--r--libbuild2/cc/pkgconfig.cxx38
1 files changed, 26 insertions, 12 deletions
diff --git a/libbuild2/cc/pkgconfig.cxx b/libbuild2/cc/pkgconfig.cxx
index 3033a2b..54fc05f 100644
--- a/libbuild2/cc/pkgconfig.cxx
+++ b/libbuild2/cc/pkgconfig.cxx
@@ -1461,18 +1461,6 @@ namespace build2
/* */ pcs::static_type)));
assert (t != nullptr);
- // This is the lib{} group if we are generating the common file and the
- // target itself otherwise.
- //
- const file& g (common ? l.group->as<file> () : l);
-
- // By default we assume things go into install.{include, lib}.
- //
- using install::resolve_dir;
-
- dir_path idir (resolve_dir (g, cast<dir_path> (g["install.include"])));
- dir_path ldir (resolve_dir (g, cast<dir_path> (g["install.lib"])));
-
const path& p (t->path ());
// If we are uninstalling, skip regenerating the file if it already
@@ -1485,6 +1473,32 @@ namespace build2
return;
}
+ // This is the lib{} group if we are generating the common file and the
+ // target itself otherwise.
+ //
+ const file& g (common ? l.group->as<file> () : l);
+
+ // By default we assume things go into install.{include, lib}.
+ //
+ // If include.lib does not resolve, then assume this is update-for-
+ // install without actual install and remove the file if it exists.
+ //
+ // @@ Shouldn't we use target's install value rather than install.lib
+ // in case it gets installed into a custom location?
+ //
+ using install::resolve_dir;
+
+ dir_path ldir (resolve_dir (g,
+ cast<dir_path> (g["install.lib"]),
+ false /* fail_unknown */));
+ if (ldir.empty ())
+ {
+ rmfile (ctx, p, 3 /* verbosity */);
+ return;
+ }
+
+ dir_path idir (resolve_dir (g, cast<dir_path> (g["install.include"])));
+
// Note that generation can take some time if we have a large number of
// prerequisite libraries.
//