From 2a0f9e035f673f1ee387924501a31990de37f18d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 24 Apr 2015 12:29:20 +0200 Subject: Implement lib/liba/libso{} target group, shared/static library build --- build/config/utility | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 build/config/utility (limited to 'build/config/utility') diff --git a/build/config/utility b/build/config/utility new file mode 100644 index 0000000..2973516 --- /dev/null +++ b/build/config/utility @@ -0,0 +1,45 @@ +// file : build/config/utility -*- C++ -*- +// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef BUILD_CONFIG_UTILITY +#define BUILD_CONFIG_UTILITY + +#include +#include // pair + +namespace build +{ + class scope; + class list_value; + + namespace config + { + // Set, if necessary, a required config.* variable. + // + // Return the reference to the value as well as the indication of + // whether the variable has actually been set. + // + template + std::pair + required (scope& root, const char* name, const T& default_value); + + std::pair + required (scope& root, const char* name, const char* default_value); + + // Set, if necessary, an optional config.* variable. In particular, + // an unspecified variable is set to NULL which is used to to + // distinguish between the "configured as unspecified" and "not + // yet configured" cases. + // + // Return the pointer to the value, which can be NULL. + // + template + const T* + optional (scope& root, const char* name); + } +} + +#include + +#endif // BUILD_CONFIG_UTILITY -- cgit v1.1