aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/config/utility.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-05-19 13:10:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-05-20 09:16:14 +0200
commit026c827b978761bf0cb618ff9429df8508cd3190 (patch)
treeb7baab17dda08d529ba7d306944342a77f598771 /libbuild2/config/utility.hxx
parent5139b4e0f76076f3fb40b30e99a461fe0947d73e (diff)
Make $config.origin() also available internally as config::origin()
Diffstat (limited to 'libbuild2/config/utility.hxx')
-rw-r--r--libbuild2/config/utility.hxx16
1 files changed, 16 insertions, 0 deletions
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<variable_origin, lookup>
+ origin (const scope& rs, const string& name);
}
}