aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/pkgconfig.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-02-03 09:45:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-02-03 09:45:46 +0200
commit90d37f3fe126fa7b3d97fb071f537f910bd4a7fa (patch)
tree95d8395498c6d2ba7909e46212414c648647855f /libbuild2/cc/pkgconfig.cxx
parent67d799852492743a93a464002395ccb624514fb8 (diff)
Propagate relevant options/prerequisites to header unit sidebuilds
Diffstat (limited to 'libbuild2/cc/pkgconfig.cxx')
-rw-r--r--libbuild2/cc/pkgconfig.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/libbuild2/cc/pkgconfig.cxx b/libbuild2/cc/pkgconfig.cxx
index be7674a..25df3df 100644
--- a/libbuild2/cc/pkgconfig.cxx
+++ b/libbuild2/cc/pkgconfig.cxx
@@ -744,7 +744,7 @@ namespace build2
};
// Parse --libs into loptions/libs (interface and implementation). If
- // ps is not NULL, add each resolves library target as a prerequisite.
+ // ps is not NULL, add each resolved library target as a prerequisite.
//
auto parse_libs = [a, &s, top_sysd, this] (target& t,
bool binless,
@@ -1239,12 +1239,14 @@ namespace build2
}
};
- // Parse importable headers and enter them as targets.
+ // Parse importable headers, enter them as targets, and add them to
+ // the prerequisites.
//
auto parse_headers = [&trace, this,
&next, &s, &lt] (const pkgconf& pc,
const target_type& tt,
- const char* lang)
+ const char* lang,
+ prerequisites& ps)
{
string var (string (lang) + "_importable_headers");
string val (pc.variable (var));
@@ -1285,6 +1287,8 @@ namespace build2
info << "make sure this header is used via " << lt
<< " prerequisite";
}
+
+ ps.push_back (prerequisite (ht));
}
};
@@ -1361,8 +1365,8 @@ namespace build2
// We treat headers outside of any project as C headers (see
// enter_header() for details).
//
- parse_headers (ipc, h::static_type /* **x_hdr */, x);
- parse_headers (ipc, h::static_type, "c");
+ parse_headers (ipc, h::static_type /* **x_hdr */, x, prs);
+ parse_headers (ipc, h::static_type, "c", prs);
}
assert (!lt.has_prerequisites ());