aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/config/functions.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-04-04 13:11:56 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-04-04 13:11:56 +0200
commit5e51d523e71231cb190e9ed981962df527f4ee7e (patch)
tree1ca26842d0629d23feb10c498364758a90f2dd68 /libbuild2/config/functions.cxx
parentb3bc26dc284cf73e97b88c9979d49368d07e686c (diff)
Add base functionality for hermetic build configurationshermetic
Diffstat (limited to 'libbuild2/config/functions.cxx')
-rw-r--r--libbuild2/config/functions.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/libbuild2/config/functions.cxx b/libbuild2/config/functions.cxx
index 5e85238..398512c 100644
--- a/libbuild2/config/functions.cxx
+++ b/libbuild2/config/functions.cxx
@@ -7,6 +7,7 @@
#include <libbuild2/function.hxx>
#include <libbuild2/variable.hxx>
+#include <libbuild2/config/module.hxx>
#include <libbuild2/config/operation.hxx>
using namespace std;
@@ -39,6 +40,11 @@ namespace build2
if (s == nullptr)
fail << "config.save() called out of project" << endf;
+ module* mod (s->find_module<module> (module::name));
+
+ if (mod == nullptr)
+ fail << "config.save() called without config module";
+
ostringstream os;
// Empty project set should is ok as long as inherit is false.
@@ -47,6 +53,7 @@ namespace build2
save_config (*s,
os, path_name ("config.save()"),
false /* inherit */,
+ *mod,
ps);
return os.str ();