From 90d37f3fe126fa7b3d97fb071f537f910bd4a7fa Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 3 Feb 2021 09:45:46 +0200 Subject: Propagate relevant options/prerequisites to header unit sidebuilds --- libbuild2/cc/pkgconfig.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'libbuild2/cc/pkgconfig.cxx') 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, <] (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 ()); -- cgit v1.1