diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-04-29 23:23:07 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-04-30 21:47:39 +0300 |
commit | 79640be325c333d77b4078d37f7668b74d5682e3 (patch) | |
tree | 5b165704351e9914e1d0fa87b787d95603a970c1 /libbbot/build-config.hxx | |
parent | d3c88705b3e3b77150f60aed2527fa60d658991e (diff) |
Add hxx extension for headers and lib prefix for library dirs
Diffstat (limited to 'libbbot/build-config.hxx')
-rw-r--r-- | libbbot/build-config.hxx | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/libbbot/build-config.hxx b/libbbot/build-config.hxx new file mode 100644 index 0000000..8a2e2d7 --- /dev/null +++ b/libbbot/build-config.hxx @@ -0,0 +1,53 @@ +// file : libbbot/build-config.hxx -*- C++ -*- +// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#ifndef LIBBBOT_BUILD_CONFIG_HXX +#define LIBBBOT_BUILD_CONFIG_HXX + +#include <string> +#include <vector> +#include <iosfwd> + +#include <butl/path> +#include <butl/optional> +#include <butl/tab-parser> +#include <butl/target-triplet> + +#include <libbbot/export.hxx> +#include <libbbot/version.hxx> + +namespace bbot +{ + // Build configuration matching specific machine names. Used by bbot + // controllers. + // + struct build_config + { + std::string machine_pattern; // Machine name pattern. + std::string name; // Configuration name. + + butl::optional<butl::target_triplet> target; + + std::vector<std::string> vars; + }; + + using build_configs = std::vector<build_config>; + + // Parse buildtab stream or file. Throw tab_parsing on parsing error, + // ios::failure on the underlying OS error. + // + // buildtab consists of lines in the following format: + // + // <machine-name-pattern> <config-name> [<target>] [<config-vars>] + // + using butl::tab_parsing; + + LIBBBOT_EXPORT build_configs + parse_buildtab (std::istream&, const std::string& name); + + LIBBBOT_EXPORT build_configs + parse_buildtab (const butl::path&); +} + +#endif // LIBBBOT_BUILD_CONFIG_HXX |