From c879b0c68235711212877fb8c5b214251bab652e Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 12 Feb 2020 20:14:41 +0300 Subject: Use copyright extracted from COPYRIGHT file for printing utility version --- bpkg/bpkg.cxx | 2 +- bpkg/buildfile | 12 ++++++++++-- 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') -- cgit v1.1