aboutsummaryrefslogtreecommitdiff
path: root/build2/version/init.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/version/init.cxx')
-rw-r--r--build2/version/init.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/build2/version/init.cxx b/build2/version/init.cxx
index 1a5f249..c4a0444 100644
--- a/build2/version/init.cxx
+++ b/build2/version/init.cxx
@@ -41,6 +41,9 @@ namespace build2
// Extract the version from the manifest file. As well as summary and
// url while at it.
//
+ // Also, as a sanity check, verify the package name matches the build
+ // system project name.
+ //
string sum;
string url;
@@ -63,6 +66,21 @@ namespace build2
for (nv = p.next (); !nv.empty (); nv = p.next ())
{
+ if (nv.name == "name")
+ {
+ auto& pn (cast<project_name> (rs.vars[var_project]));
+
+ if (nv.value != pn.string ())
+ {
+ path bf (rs.src_path () / rs.root_extra->bootstrap_file);
+ location ml (&f, nv.value_line, nv.value_column);
+ location bl (&bf);
+
+ fail (ml) << "package name " << nv.value << " does not match "
+ << "build system project name " << pn <<
+ info (bl) << "build system project name specified here";
+ }
+ }
if (nv.name == "summary")
sum = move (nv.value);
else if (nv.name == "url")