From 026c827b978761bf0cb618ff9429df8508cd3190 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 19 May 2022 13:10:54 +0200 Subject: Make $config.origin() also available internally as config::origin() --- libbuild2/config/utility.hxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libbuild2/config/utility.hxx') diff --git a/libbuild2/config/utility.hxx b/libbuild2/config/utility.hxx index cb82ea6..5a00d00 100644 --- a/libbuild2/config/utility.hxx +++ b/libbuild2/config/utility.hxx @@ -501,6 +501,22 @@ namespace build2 // LIBBUILD2_SYMEXPORT bool unconfigured (scope& rs, const string& var, bool value); + + // Return the origin of the value of the specified configuration variable + // plus the value itself. See $config.origin() for details. + // + // Throws invalid_argument if the passed variable is not config.*. + // + enum class variable_origin + { + undefined, // Undefined. + default_, // Default value from the config directive. + buildfile, // Value from a buildfile, normally config.build. + override_ // Value from a command line override. + }; + + LIBBUILD2_SYMEXPORT pair + origin (const scope& rs, const string& name); } } -- cgit v1.1