aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-02-12 20:14:41 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-02-12 20:14:41 +0300
commitc879b0c68235711212877fb8c5b214251bab652e (patch)
treea9cc68617cc109245423541cf4ba1e2c32e2a2d2
parente222926ad4741e130abdadeb524de55e89d141a7 (diff)
Use copyright extracted from COPYRIGHT file for printing utility version
-rw-r--r--bpkg/bpkg.cxx2
-rw-r--r--bpkg/buildfile12
2 files changed, 11 insertions, 3 deletions
diff --git a/bpkg/bpkg.cxx b/bpkg/bpkg.cxx
index 1417d86..ffc91ab 100644
--- a/bpkg/bpkg.cxx
+++ b/bpkg/bpkg.cxx
@@ -353,7 +353,7 @@ try
cout << "bpkg " << BPKG_VERSION_ID << endl
<< "libbpkg " << LIBBPKG_VERSION_ID << endl
<< "libbutl " << LIBBUTL_VERSION_ID << endl
- << "Copyright (c) 2014-2019 Code Synthesis Ltd" << endl
+ << "Copyright (c) " << BPKG_COPYRIGHT << "." << endl
<< "This is free software released under the MIT license." << endl;
return 0;
}
diff --git a/bpkg/buildfile b/bpkg/buildfile
index 968f425..dc900d8 100644
--- a/bpkg/buildfile
+++ b/bpkg/buildfile
@@ -82,6 +82,16 @@ for t: cxx{**.test...}
# Build options.
#
+obj{utility}: cxx.poptions += -DBPKG_EXE_SUFFIX='"'$bin.exe.suffix'"'
+
+# Pass the copyright notice extracted from the COPYRIGHT file.
+#
+copyright = $process.run_regex(cat $src_root/COPYRIGHT, \
+ 'Copyright \(c\) (.+)\.', \
+ '\1')
+
+obj{bpkg}: cxx.poptions += -DBPKG_COPYRIGHT=\"$copyright\"
+
# Disable "unknown pragma" warnings.
#
switch $cxx.class
@@ -98,8 +108,6 @@ switch $cxx.class
if ($cxx.id == 'msvc' && $cxx.version.major == 19 && $cxx.version.minor < 10)
cxx.coptions += /wd4503
-obj{utility}: cxx.poptions += -DBPKG_EXE_SUFFIX='"'$bin.exe.suffix'"'
-
# Make sure backtrace includes function names.
#
if ($cxx.target.class == 'linux')