From f013fac528515dad78c9a624216b1e0217a5f3bb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Jan 2016 10:26:47 +0200 Subject: "Hello World" formatter C++ library with build2 --- format/buildfile | 8 ++++++++ format/format | 8 ++++++++ format/format.cxx | 11 +++++++++++ 3 files changed, 27 insertions(+) create mode 100644 format/buildfile create mode 100644 format/format create mode 100644 format/format.cxx (limited to 'format') diff --git a/format/buildfile b/format/buildfile new file mode 100644 index 0000000..4edb840 --- /dev/null +++ b/format/buildfile @@ -0,0 +1,8 @@ +lib{format}: {hxx cxx}{format} + +cxx.poptions += -I$src_root +lib{format}: cxx.export.poptions = -I$src_root + +# Install into the format/ subdirectory of, say, /usr/include/. +# +install.include = $install.include/format diff --git a/format/format b/format/format new file mode 100644 index 0000000..6c4d5f8 --- /dev/null +++ b/format/format @@ -0,0 +1,8 @@ +// file: format/format -*- C++ -*- + +#pragma once + +#include + +std::string +format (const std::string& greeting, const std::string& name); diff --git a/format/format.cxx b/format/format.cxx new file mode 100644 index 0000000..0566e78 --- /dev/null +++ b/format/format.cxx @@ -0,0 +1,11 @@ +// file: format/format.cxx -*- C++ -*- + +#include + +using namespace std; + +string +format (const string& g, const string& n) +{ + return g + ", " + n + '!'; +} -- cgit v1.1