aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/build/script/script.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-05-26 14:55:40 +0300
committerBoris Kolpackov <boris@codesynthesis.com>2020-05-27 14:38:01 +0200
commitd6581aa9be74e83cc689bfdaae9aaf2e78287975 (patch)
treee741d2c6fcdb567d8c7b897d17f3f0ca2358d307 /libbuild2/build/script/script.hxx
parente6470e37093084251b7ee60a904a78e54d13e31b (diff)
Create build script temporary directory on demand
Diffstat (limited to 'libbuild2/build/script/script.hxx')
-rw-r--r--libbuild2/build/script/script.hxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/libbuild2/build/script/script.hxx b/libbuild2/build/script/script.hxx
index 2139f28..7d27840 100644
--- a/libbuild2/build/script/script.hxx
+++ b/libbuild2/build/script/script.hxx
@@ -41,7 +41,7 @@ namespace build2
// Note that the variables are not pre-entered into a pool during the
// parsing phase, so the line variable pointers are NULL.
//
- build2::script::lines lines;
+ build2::script::lines lines;
// Referenced ordinary (non-special) variables.
//
@@ -55,6 +55,10 @@ namespace build2
//
small_vector<string, 1> vars;
+ // True if script references the $~ special variable.
+ //
+ bool temp_dir = false;
+
location start_loc;
location end_loc;
};
@@ -101,7 +105,15 @@ namespace build2
auto_rmdir temp_dir;
virtual void
- set_variable (string&& name, names&&, const string& attrs) override;
+ set_variable (string&& name,
+ names&&,
+ const string& attrs,
+ const location&) override;
+
+ // Create the temporary directory and set the $~ variable.
+ //
+ virtual void
+ create_temp_dir () override;
// Variables.
//