intf_libs = # Interface dependencies.
impl_libs = # Implementation dependencies.
#import xxxx_libs += libhello%lib{hello}

lib{cpp-base64}: libul{cpp-base64}: {hxx cxx}{**} $impl_libs $intf_libs

libs{cpp-base64}: def{cpp-base64}: include = ($cxx.target.system == 'win32-msvc')
def{cpp-base64}: libul{cpp-base64}

# Build options.
#
# $src_root makes <cpp-base64/base64.h> work. $src_base is the directory that
# contains base64.h, so upstream TUs can keep #include "base64.h".
#
out_pfx     = [dir_path] $out_root/
src_pfx     = [dir_path] $src_root/
out_pfx_unq = [dir_path] $out_base/
src_pfx_unq = [dir_path] $src_base/

cxx.poptions =+ "-I$out_pfx" "-I$src_pfx" \
                "-I$out_pfx_unq" "-I$src_pfx_unq"

if ($cxx.target.system == 'mingw32')
  cxx.loptions += -Wl,--export-all-symbols

# Export options.
#
# Dual inclusion: also support #include <base64.h>.
#
lib{cpp-base64}:
{
  cxx.export.poptions = "-I$out_pfx" "-I$src_pfx" \
                        "-I$out_pfx_unq" "-I$src_pfx_unq"
  cxx.export.libs = $intf_libs
}

lib{cpp-base64}: cxx.pkgconfig.include = include/ include/cpp-base64/

# For pre-releases use the complete version to make sure they cannot
# be used in place of another pre-release or the final version. See
# the version module for details on the version.* variable values.
#
if $version.pre_release
  lib{cpp-base64}: bin.lib.version = "-$version.project_id"
else
  lib{cpp-base64}: bin.lib.version = "-$version.major.$version.minor"

# Install into the cpp-base64/ subdirectory of, say, /usr/include/
# recreating subdirectories.
#
hxx{*}:
{
  install         = include/cpp-base64/
  install.subdirs = true
}
