From 5e51d523e71231cb190e9ed981962df527f4ee7e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 4 Apr 2021 13:11:56 +0200 Subject: Add base functionality for hermetic build configurations --- libbuild2/config/functions.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libbuild2/config/functions.cxx') 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 #include +#include #include 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::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 (); -- cgit v1.1