aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-07-02 15:28:13 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-07-02 15:28:13 +0200
commitbbfef572a25878f731566c8280814355b500e375 (patch)
tree09fa8dc39b6ac6e8d93437d1768e3f00c6fca63d /libbuild2/cc
parent83c09ca38fdc7fa97d5cb547eb6c51ddca48cc4d (diff)
Add note on version we save in pkg-config files
Diffstat (limited to 'libbuild2/cc')
-rw-r--r--libbuild2/cc/pkgconfig.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/libbuild2/cc/pkgconfig.cxx b/libbuild2/cc/pkgconfig.cxx
index 8b064d1..acf8266 100644
--- a/libbuild2/cc/pkgconfig.cxx
+++ b/libbuild2/cc/pkgconfig.cxx
@@ -1809,6 +1809,20 @@ namespace build2
fail << "no version variable in project " << n <<
info << "while generating " << p;
+ // When comparing versions, pkg-config uses RPM semantics, which is
+ // basically comparing each all-digit/alpha fragments in order.
+ // This means, for example, a semver with a pre-release will be
+ // compared incorrectly (pre-release will be greater than the final
+ // version). We could detect if this project uses stdver and chop
+ // off any pre-release information (so, essentially only saving the
+ // major.minor.patch part). But that means such .pc files will
+ // contain inaccurate version information. And seeing that we don't
+ // recommend using pkg-config (rather primitive) package dependency
+ // support, having complete version information for documentation
+ // seems more important.
+ //
+ // @@ Maybe still makes sense to only save version.project_id?
+ //
const string& v (cast<string> (vl));
os << "Name: " << n << endl;